]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoBuild libgcov only if we're building base system GCC
emaste [Mon, 18 May 2015 15:02:35 +0000 (15:02 +0000)]
Build libgcov only if we're building base system GCC

Clang uses compiler-rt for the code coverage runtime, and ports GCC
provides its own libgcov.

PR: 200203 (exp-run)
Sponsored by: The FreeBSD Foundation

9 years agofd: fix imbalanced fdp unlock in F_SETLK and F_GETLK
mjg [Mon, 18 May 2015 14:27:04 +0000 (14:27 +0000)]
fd: fix imbalanced fdp unlock in F_SETLK and F_GETLK

MFC after: 3 days

9 years agoTidy up sys_umask a little bit
mjg [Mon, 18 May 2015 13:43:33 +0000 (13:43 +0000)]
Tidy up sys_umask a little bit

Consistently use saved fdp pointer as it cannot change. If it could change the
code would be already incorrect.

No functional changes.

9 years agoClean up the Amlogic interrupt controller driver to handle the case where
andrew [Mon, 18 May 2015 11:04:07 +0000 (11:04 +0000)]
Clean up the Amlogic interrupt controller driver to handle the case where
we have both the Amlogic pic and a GIC. This may be the case in some
configurations.

Differential Revision: https://reviews.freebsd.org/D2432
Submitted by: John Wehle <john@feith.com>

9 years agoMove all test integration pieces for etc/ from etc/ to tests/
ngie [Mon, 18 May 2015 11:02:43 +0000 (11:02 +0000)]
Move all test integration pieces for etc/ from etc/ to tests/

This is being done to fix breakage with make distribution with read-only
source trees as make distribution doesn't use make obj like building
tests/ does in all cases

Reported by: Wolfgang Zenker <wolfgang@lyxys.ka.sub.org>
Suggested by: jhb
X-MFC with: r282059
MFC after: 1 week

9 years agoAdd support for SCSI disk hot add and remove. Also add padding according to
whu [Mon, 18 May 2015 10:31:23 +0000 (10:31 +0000)]
Add support for SCSI disk hot add and remove. Also add padding according to
the requirement of different hypervisor releases.

Submitted by: whu
Reviewed by: royger
Approved by: royger
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D2512

9 years agoClean up the style to be "include<space><tab>" and remove options already
andrew [Mon, 18 May 2015 08:12:08 +0000 (08:12 +0000)]
Clean up the style to be "include<space><tab>" and remove options already
in std.armv6.

9 years agosfxge: do not advertise LRO capability if LRO is compiled out
arybchik [Mon, 18 May 2015 06:07:02 +0000 (06:07 +0000)]
sfxge: do not advertise LRO capability if LRO is compiled out

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2565

9 years agosfxge: automatically turn off TSO when Tx checksum offload is disabled
arybchik [Mon, 18 May 2015 06:04:20 +0000 (06:04 +0000)]
sfxge: automatically turn off TSO when Tx checksum offload is disabled

Also return error if TSO is requested without Tx checksum offload.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2564

9 years agosfxge: allow to disable checksum offloads over VLAN
arybchik [Mon, 18 May 2015 06:03:21 +0000 (06:03 +0000)]
sfxge: allow to disable checksum offloads over VLAN

It just affects capabilities of the created VLAN interface.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2563

9 years agosfxge: fix overflow queue freeze
arybchik [Mon, 18 May 2015 06:02:22 +0000 (06:02 +0000)]
sfxge: fix overflow queue freeze

If TxQ lock is obtained, deferred packet list shold be serviced even if
the packet addition fails because of overflow.

Without the patch freeze happens if:
 - queue is not blocked (i.e. completion does not trigger unblock and service)
 - put-list overflow (1024 entries)
 - sfxge_tx_packet_add() acquires TxQ lock just as it is released it in
   sfxge_tx_qdpl_service() on the second CPU but before pending check
 - sfxge_tx_packet_add() swizzles put-list to get-list, fails because of
   non-tcp get-list overflow and returns without packet list service
 - sfxge_tx_qdpl_service() on the second CPU checks that there are no
   pending packets in the put-list and returns

Other possible solution is to guaranee that maximum length of the put-list
is less than maximum length of any get-list.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2562

9 years agoMFV of 283040,tzdata{2015c}
edwin [Mon, 18 May 2015 01:59:02 +0000 (01:59 +0000)]
MFV of 283040,tzdata{2015c}

Update to tzdata2015c:

    Release 2015c - 2015-04-11 08:55:55 -0700

    Changes affecting future time stamps

    Egypt's spring-forward transition is at 24:00 on April's last Thursday,
    not 00:00 on April's last Friday.  2015's transition will therefore be on
    Thursday, April 30 at 24:00, not Friday, April 24 at 00:00.  Similar fixes
    apply to 2026, 2037, 2043, etc.  (Thanks to Steffen Thorsen.)

9 years agoFix a typo that snuck in with r283024, and remove the EXFAIL annotation from
markj [Sun, 17 May 2015 23:09:58 +0000 (23:09 +0000)]
Fix a typo that snuck in with r283024, and remove the EXFAIL annotation from
a test which now passes as a result of that change.

9 years agoRespect the libdir option when linking drti.o, rather than hardcoding the
markj [Sun, 17 May 2015 23:08:01 +0000 (23:08 +0000)]
Respect the libdir option when linking drti.o, rather than hardcoding the
default path of /usr/lib(32)/dtrace.

MFC after: 3 weeks

9 years agoAn ARM kernel can be loaded at any 2MB boundary, make ubldr aware of that.
ian [Sun, 17 May 2015 19:59:05 +0000 (19:59 +0000)]
An ARM kernel can be loaded at any 2MB boundary, make ubldr aware of that.

Previously, ubldr would use the virtual addresses in the elf headers by
masking off the high bits and assuming the result was a physical address
where the kernel should be loaded.  That would sometimes discard
significant bits of the physical address, but the effects of that were
undone by archsw copy code that would find a large block of memory and
apply an offset to the source/dest copy addresses.  The result was that
things were loaded at a different physical address than requested by the
higher code layers, but that worked because other adjustments were applied
later (such as when jumping to the entry point).  Very confusing, and
somewhat fragile.

Now the archsw copy routines are just simple copies, and instead
archsw.arch_loadaddr is implemented to choose a load address.  The new
routine uses some of the code from the old offset-translation routine to
find the largest block of ram, but it excludes ubldr itself from that
range, and also excludes   If ubldr splits the largest block of ram in
two, the kernel is loaded into the bottom of whichever resulting block is
larger.

As part of eliminating ubldr itself from the ram ranges, export the heap
start/end addresses in a pair of new global variables.

This change means that the virtual addresses in the arm kernel elf headers
now have no meaning at all, except for the entry point address.  There is
an implicit assumption that the entry point is in the first text page, and
that the address in the the header can be turned into an offset by masking
it with PAGE_MASK.  In the future we can link all arm kernels at a virtual
address of 0xC0000000 with no need to use any low-order part of the
address to influence where in ram the kernel gets loaded.

9 years agoClean up struct syscall_args:
andrew [Sun, 17 May 2015 18:35:58 +0000 (18:35 +0000)]
Clean up struct syscall_args:
 1. Align to a 64-bit address so 64-bit data will be correctly aligned.
 2. Add a comment explaining why.
 3. Remove an unneeded value from the struct.

This fixes an issue where the struct may not be correctly aligned on the
stack in the syscall function. This may lead to accesing a 64-bit value
at a non 64-bit. This will raise an exception and panic the kernel.

We have been lucky where on arm and armv6 both clang and gcc correctly
align the data, even without us asking to, however, on armeb with clang to
not be the case. This tells the compiler we really do need this to be
aligned.

Reported and tested by: jmg (on armeb with clang)
MFC after: 1 Week [1, 2]

9 years agoDo not set preload_addr_relocate for ARM. Apparently there was a time
ian [Sun, 17 May 2015 17:03:37 +0000 (17:03 +0000)]
Do not set preload_addr_relocate for ARM.  Apparently there was a time
when loader(8) passed physical addresses in loader metadata for arm, but
that is no longer true; all metadata has already been adjusted to vitual
addresses by loader.

I can't track down the exact revision in loader where a change from physical
to virtual metadata addresses happened.  The code involved is very twisty
and complicated.  I suspect the change was an unintended consequence of the
r247301, r247413, r248118 series of changes I made a couple years ago.

9 years agoIn r279493, the functions pzero[f](), qzero[f], pone[f](),
kargl [Sun, 17 May 2015 16:27:06 +0000 (16:27 +0000)]
In r279493, the functions pzero[f](), qzero[f], pone[f](),
and qone[f]() were marked as __inline, but their forward
declarations were not updated.  Fix the forward declarations
to match the actual function declarations.

Requested by:  bde

9 years agoUpdate intree gdb/kgdb to handle 2 dwarf types:
sbruno [Sun, 17 May 2015 15:49:38 +0000 (15:49 +0000)]
Update intree gdb/kgdb to handle 2 dwarf types:
DW_OP_GNU_uninit
DW_OP_piece

This squashes the warnings about type 0x93 not known in kgdb when opening a kernel crash dump.

Upstream refs:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=87808bd699575a850139a1f916512ab7a47fd496
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=42be36b328ae784ae6981da7c7cab95b67ed7737
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=23572ecadc89af384c1804ad7692f32c55fbfc80

Differential Revision: https://reviews.freebsd.org/D2534
Reviewed by: emaste, jhb, davide

9 years agoAdjust the string format to match the actual number of arguments.
loos [Sun, 17 May 2015 15:12:55 +0000 (15:12 +0000)]
Adjust the string format to match the actual number of arguments.

This fix a segmentation fault on ARM when netstat -r is used together with
-W.

This issue was introduced in r279122.

9 years agoActually remove siftr-related definitions from tcp.d, missed in r283026.
markj [Sun, 17 May 2015 04:17:08 +0000 (04:17 +0000)]
Actually remove siftr-related definitions from tcp.d, missed in r283026.

9 years agoMove siftr-related definitions out of tcp.d and into a separate library
markj [Sun, 17 May 2015 04:09:22 +0000 (04:09 +0000)]
Move siftr-related definitions out of tcp.d and into a separate library
which declares a dependency on siftr(4). This is necessitated by a
reference to struct pkt_node, which is defined in siftr(4): otherwise,
dtrace(1) will return an error during startup if siftr.ko is not loaded.

9 years agoAs dtrace(1) processes D libraries under /usr/lib/dtrace, the compiler may
markj [Sun, 17 May 2015 03:59:08 +0000 (03:59 +0000)]
As dtrace(1) processes D libraries under /usr/lib/dtrace, the compiler may
return an error if one of the depends_on directives in a library is not
satisfied. In this case, libdtrace is supposed to ignore the library and
carry on. However, the remainder of the library may still be buffered by
the lexer, causing libdtrace to erroneously continue processing it on the
next call to yyparse(). Fix this by explicitly flushing the input buffer
each time the compiler state is reset.

MFC after: 3 weeks

9 years agoWhen in lazyload mode, write the DOF to a temporary file and rename it
markj [Sun, 17 May 2015 03:50:42 +0000 (03:50 +0000)]
When in lazyload mode, write the DOF to a temporary file and rename it
rather than writing directly to the output file.

CID: 1147172

9 years agobsdinstall/zfsboot: Skip adding swap lines to /etc/fstab if swap is 0 sized
allanjude [Sun, 17 May 2015 00:55:44 +0000 (00:55 +0000)]
bsdinstall/zfsboot: Skip adding swap lines to /etc/fstab if swap is 0 sized

Differential Revision: https://reviews.freebsd.org/D2571
Reviewed by: dim
Approved by: eadler (mentor)
Sponsored by: ScaleEngine Inc.

9 years agoIncrement the vm stats "v_intr" counter so the global system interrupt
adrian [Sat, 16 May 2015 23:51:24 +0000 (23:51 +0000)]
Increment the vm stats "v_intr" counter so the global system interrupt
statistics work again.

I'm not sure why/when this broke, only that it used to work fine.

This commit is brought to you by Maker Faire Bay Area 2015.

9 years agoFix more warnings related to missing headers
ngie [Sat, 16 May 2015 22:53:26 +0000 (22:53 +0000)]
Fix more warnings related to missing headers

MFC after: 1 week

9 years agoDon't allow unmapped I/O. The pmap isn't quite up to the task. Add a
imp [Sat, 16 May 2015 21:24:32 +0000 (21:24 +0000)]
Don't allow unmapped I/O. The pmap isn't quite up to the task. Add a
comment to this effect and switch the default. My old AT91SAM9G20
now boots, fsck's the SD card and runs w/o an issue for the first
time since a 9.1-ish stable build I did a few years ago.

Problems with unmapped I/O:
o un-page-aligned I/O requests to devices fail (notably fsck
  and newfs).
o write-back caching was totally broken. write-through caching
  needed to be enabled.
o Even page-aligned I/O requests sometimes failed for reasons
  not thoroughly investigated.

Suggested by: ian@
MFC after: 2 days

9 years agoRe-link ubldr when any of its libraries change.
ian [Sat, 16 May 2015 21:08:33 +0000 (21:08 +0000)]
Re-link ubldr when any of its libraries change.

9 years agoacpi_ibm: whitespace.
rpaulo [Sat, 16 May 2015 20:06:39 +0000 (20:06 +0000)]
acpi_ibm: whitespace.

9 years agoMore tr -d '\r' t make config happy and
bz [Sat, 16 May 2015 20:04:49 +0000 (20:04 +0000)]
More tr -d '\r' t make config happy and
some re-alignment whitespace changes.

9 years ago* Update SFF-8024 Identifier constants.
melifaro [Sat, 16 May 2015 13:11:35 +0000 (13:11 +0000)]
* Update SFF-8024 Identifier constants.
* Fix SFF_8436_CC_EXT in SFF-8436 memory map.
* Add SFF-8436/8636 bits (revision compliance/nominal bitrate).
* Do some small style/type fixes.

9 years agoAdd a warning message to mountd for exported file
rmacklem [Sat, 16 May 2015 12:05:26 +0000 (12:05 +0000)]
Add a warning message to mountd for exported file
systems that are automounted, since that configuration
isn't supported. This still allows the export, since
two emails I received felt that this should not be
disabled. It sends the message to syslog(LOG_ERR..), so that
it goes to the same places as the other messages related
to /etc/exports problems, even though it is a warning and not an error.

Reviewed by: trasz
MFC after: 2 weeks

9 years agosfxge: avoid usage of ifm_data
arybchik [Sat, 16 May 2015 10:35:30 +0000 (10:35 +0000)]
sfxge: avoid usage of ifm_data

The driver uses ifm_data to save capabilities mask calculated during
initialization when supported phy modes are discovered.
The patch simply calculates it when either media or options are changed.

Reviewed by:    glebius
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2540

9 years agoMinor comments fixes
thomas [Sat, 16 May 2015 10:31:15 +0000 (10:31 +0000)]
Minor comments fixes

9 years agotr -d '\r' makes config a lot more happy.
bz [Sat, 16 May 2015 10:27:27 +0000 (10:27 +0000)]
tr -d '\r' makes config a lot more happy.

9 years agopath.h is not needed here.
delphij [Sat, 16 May 2015 08:12:00 +0000 (08:12 +0000)]
path.h is not needed here.

9 years agoMake these all work with the new way of doing privatelib.
adrian [Sat, 16 May 2015 06:18:39 +0000 (06:18 +0000)]
Make these all work with the new way of doing privatelib.

Without these CFLAGS settings a cross-compile won't find the headers
anywhere.

Tested:

* mips (32, big endian) cross-build w/ LOCAL_DIRS including these
  tools.

9 years agossh-copy-id: Add missing line continuation
eadler [Sat, 16 May 2015 06:15:49 +0000 (06:15 +0000)]
ssh-copy-id: Add missing line continuation

PR: 194301
Reported by: pkubaj@riseup.net
Patch by: Ross Kilgariff <rosskilgariff@gmail.com>

9 years agosfxge: add local variable with changed capabilities mask
arybchik [Sat, 16 May 2015 06:04:53 +0000 (06:04 +0000)]
sfxge: add local variable with changed capabilities mask

It is required for the next patch which adds dependency of TSO
capabilities from Tx checksum offloads.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2553

9 years agoVarious iwn(4) fixes.
adrian [Sat, 16 May 2015 05:59:25 +0000 (05:59 +0000)]
Various iwn(4) fixes.

* simplify channel logic for determining RF gain setting in scan setup
* don't set TX timer on error
* free node references for unsent frames on device stop
* set maxfrags to IWN_MAX_SCATTER-1 (first segment is used by TX command)
* add missing IWN_UNLOCK() from interrupt path when the hardware
  disappears.
* pass control frames to host
* nitems() instead of local macro

Tested:

* Intel 5100, STA mode

PR: kern/196264
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agosfxge: move mbuf free to sfxge_if_transmit()
arybchik [Sat, 16 May 2015 05:43:20 +0000 (05:43 +0000)]
sfxge: move mbuf free to sfxge_if_transmit()

It is a preparation to the next patch which will service packet queue even
if packet addtion fails.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2552

9 years agosfxge: get rid of locked variable in sfxge_tx_packet_add()
arybchik [Sat, 16 May 2015 05:37:47 +0000 (05:37 +0000)]
sfxge: get rid of locked variable in sfxge_tx_packet_add()

Now each branch has one and only one possible TxQ lock state.
It simplifies understanding of the code.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2551

9 years agosfxge: support Rx checksum offloads disabling
arybchik [Sat, 16 May 2015 05:36:40 +0000 (05:36 +0000)]
sfxge: support Rx checksum offloads disabling

We can't disable it in HW, but we can ignore result.
Discard Rx descriptor checksum flags if Rx checksum offload is off.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2544

9 years agoProvide reallocarray() in -legacy, if needed, to allow building head on
dim [Fri, 15 May 2015 22:19:35 +0000 (22:19 +0000)]
Provide reallocarray() in -legacy, if needed, to allow building head on
previous releases.

Also add a stdlib.h wrapper, which declares the function, otherwise the
compiler may assume it returns int, which can cause segfaults on LP64
architectures.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D2558

9 years agoUpdate the comments to match what the code ended up becoming.
adrian [Fri, 15 May 2015 21:33:19 +0000 (21:33 +0000)]
Update the comments to match what the code ended up becoming.

-1 is now "no locality information available".

Sponsored by: Norse Corp, Inc.

9 years agoBreak apart the gnu_inline attribute and use "artificial" if available.
pfg [Fri, 15 May 2015 20:53:43 +0000 (20:53 +0000)]
Break apart the gnu_inline attribute and use "artificial" if available.

Missing #endif (in wrong place)

Pointed hat: me

9 years agoBreak apart the gnu_inline attribute and use "artificial" if available.
pfg [Fri, 15 May 2015 20:47:25 +0000 (20:47 +0000)]
Break apart the gnu_inline attribute and use "artificial" if available.

Missing #endif

Reported by: jhb, jenkins
Pointed hat: me

9 years agoMake use of GCC alloc_align attribute
pfg [Fri, 15 May 2015 20:43:37 +0000 (20:43 +0000)]
Make use of GCC alloc_align attribute

This lets the compiler know about the alignment of pointers returned
by aligned_alloc(3), posix_memalign(3). and contigmalloc(9)

Currently this is only supported in recent gcc but we are ready to
use it if clang implements it.

Relnotes: yes

9 years agoBreak apart the gnu_inline attribute and use "artificial" if available.
pfg [Fri, 15 May 2015 19:51:05 +0000 (19:51 +0000)]
Break apart the gnu_inline attribute and use "artificial" if available.

In general it is bad practice to use the gnu_inline attribute but we
will need it in special cases like FORTIFY_SOURCE. In this specific
case it is also useful to have the "artificial" attribute:

"This attribute is useful for small inline wrappers which if possible
should appear during debugging as a unit, depending on the debug info
format it will either mean marking the function as artificial or using the
caller location for all instructions within the inlined body."

This attribute appears to be currently implemented only in GCC. Use it
only in conjuntion with gnu_inline in the cases where it is available,
which is similar in spirit in how it's used in glibc.

9 years agoCorrect location for libntpevent.a.
cy [Fri, 15 May 2015 19:37:17 +0000 (19:37 +0000)]
Correct location for libntpevent.a.

9 years agoIntroduce support for the Alpine PoC from Annapurna Labs
zbb [Fri, 15 May 2015 18:25:48 +0000 (18:25 +0000)]
Introduce support for the Alpine PoC from Annapurna Labs

The Alpine Platform-On-Chip offers multicore processing
(quad ARM Cortex-A15), 1/10Gb Ethernet, SATA 3, PCI-E 3,
DMA engines, Virtualization, Advanced Power Management and other.

This code drop involves basic platform support including:
SMP, IRQs, SerDes, SATA. As of now it is missing the PCIe support.
Part of the functionality is provided by the low-level code (HAL)
delivered by the chip vendor (Annapurna Labs) and is a subject to
change in the future (is planned to be moved to sys/contrib directory).

The review log for this commit is available here:
https://reviews.freebsd.org/D2340

Reviewed by:    andrew, ian, imp
Obtained from:  Semihalf
Sponsored by:   Annapurna Labs

9 years agoAdd assertions that the addresses passed to tlb maintenance are page-aligned.
ian [Fri, 15 May 2015 18:10:00 +0000 (18:10 +0000)]
Add assertions that the addresses passed to tlb maintenance are page-aligned.

Perform cache writebacks and invalidations in the correct (inner to outer
or vice versa) order, and add comments that explain that.

Consistantly use 'va' as the variable name for virtual addresses.

Submitted by: Michal Meloun <meloun@miracle.cz>

9 years agoRetrieve the cache parms in the proper arch-specific way.
ian [Fri, 15 May 2015 18:07:58 +0000 (18:07 +0000)]
Retrieve the cache parms in the proper arch-specific way.

Submitted by: Michal Meloun <meloun@miracle.cz>

9 years agoSummary: Remove spurious, extra, next header comments.
gnn [Fri, 15 May 2015 18:04:49 +0000 (18:04 +0000)]
Summary: Remove spurious, extra, next header comments.
Correct the name of the pad length field.

9 years agoReplace a CONSTCOND for a void value as a replacement for __unreachable builtin
pfg [Fri, 15 May 2015 17:51:03 +0000 (17:51 +0000)]
Replace a CONSTCOND for a void value as a replacement for __unreachable builtin

This only applies if we are not using clang or gcc but it lets us use the
__unreachable() buitin in expressions.

Suggested by: tijl

9 years agoAllow MANWIDTH to work with mandoc(1)
bapt [Fri, 15 May 2015 15:56:28 +0000 (15:56 +0000)]
Allow MANWIDTH to work with mandoc(1)

Reported by: bdrewery

9 years agoWhen a netmap process terminates without the full set of buffers it
pkelsey [Fri, 15 May 2015 15:36:57 +0000 (15:36 +0000)]
When a netmap process terminates without the full set of buffers it
was granted via rings and ni_bufs_list_head represented in those rings
and lists (e.g., via SIGKILL), those buffers are no longer available
for subsequent users for the lifetime of the system. To mitigate this
resource leak, reset the allocator state when the last ref to that
allocator is released.

Note that this only recovers leaked resources for an allocator when
there are no longer any users of that allocator, so there remain
circumstances in which leaked allocator resources may not ever be
recovered - consider a set of multiple netmap processes that are all
using the same allocator (say, the global allocator) where members of
that set may be killed and restarted over time but at any given point
there is one member of that set running.

Based on intial work by adrian@.

Reviewed by: Giuseppe Lettieri (g.lettieri@iet.unipi.it), luigi
Approved by: jmallett (mentor)
MFC after: 1 week
Sponsored by: Norse Corp, Inc.

9 years agoBuild libgomp only if we're also building base system GCC
emaste [Fri, 15 May 2015 14:22:33 +0000 (14:22 +0000)]
Build libgomp only if we're also building base system GCC

Clang's OpenMP support will emit Intel OpenMP API library calls,
and will therefore require libiomp (or whatever name is settled on).
An up-to-date version of libgomp is included in ports or pkg GCC.
Thus, there is no reason to build base libgomp without base system GCC.

PR: 199979 (exp-run)
Reviewed by: pfg
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2459

9 years agoProvide the number of interrupt resources added to the list
br [Fri, 15 May 2015 13:55:18 +0000 (13:55 +0000)]
Provide the number of interrupt resources added to the list
by using extra argument, so caller will know that.

9 years agoPreviously, cv_waiters was only updated by cv_signal or cv_wait. If a
jhb [Fri, 15 May 2015 13:50:37 +0000 (13:50 +0000)]
Previously, cv_waiters was only updated by cv_signal or cv_wait. If a
thread awakened due to a time out, then cv_waiters was not decremented.
If INT_MAX threads timed out on a cv without an intervening cv_broadcast,
then cv_waiters could overflow. To fix this, have each sleeping thread
decrement cv_waiters when it resumes.

Note that previously cv_waiters was protected by the sleepq chain lock.
However, that lock is not held when threads resume from sleep. In
addition, the interlock is also not always reacquired after resuming
(cv_wait_unlock), nor is it always held by callers of cv_signal() or
cv_broadcast(). Instead, use atomic ops to update cv_waiters. Since
the sleepq chain lock is still held on every increment, it should
still be safe to compare cv_waiters against zero while holding the
lock in the wakeup routines as the only way the race should be lost
would result in extra calls to sleepq_signal() or sleepq_broadcast().

Differential Revision: https://reviews.freebsd.org/D2427
Reviewed by: benno
Reported by: benno (wrap of cv_waiters in the field)
MFC after: 2 weeks

9 years agoClose some potential races around socket start/close.
mav [Fri, 15 May 2015 13:36:50 +0000 (13:36 +0000)]
Close some potential races around socket start/close.

There are some reports about panics on ic->ic_socket NULL derefence.
This kind of races is the only way I can imagine it to happen.

MFC after: 2 weeks

9 years agoBump date for iic.4
jah [Fri, 15 May 2015 13:04:14 +0000 (13:04 +0000)]
Bump date for iic.4

9 years agoSimplify i2c reader: we don't need per-NIC handler anymore.
melifaro [Fri, 15 May 2015 12:32:17 +0000 (12:32 +0000)]
Simplify i2c reader: we don't need per-NIC handler anymore.
Make code use read_i2c() function instead of callback.
Simplify&document struct i2c_info.
Consistently use uint8_t to read from i2c.

9 years agoUpdate iic(4) man page to reflect recent changes
jah [Fri, 15 May 2015 12:28:17 +0000 (12:28 +0000)]
Update iic(4) man page to reflect recent changes

Differential Revision: https://reviews.freebsd.org/D2461
Reviewed by: wblock
Approved by: kib (mentor)

9 years agoAdd an ability accept encapsulated packets from different sources by one
ae [Fri, 15 May 2015 12:19:45 +0000 (12:19 +0000)]
Add an ability accept encapsulated packets from different sources by one
gif(4) interface. Add new option "ignore_source" for gif(4) interface.
When it is enabled, gif's encapcheck function requires match only for
packet's destination address.

Differential Revision: https://reviews.freebsd.org/D2004
Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC

9 years agoSome third-party malloc(3) implementations use pthread_setspecific(3)
kib [Fri, 15 May 2015 08:40:17 +0000 (08:40 +0000)]
Some third-party malloc(3) implementations use pthread_setspecific(3)
to handle per-thread information.  Since our pthread_setspecific()
implementation calls calloc(3) to allocate per-thread specific data
storage, things get complicated.

Switch the allocator to use bare mmap(2).  There is some loss of the
allocated page, since e.g. on amd64, PTHREAD_KEYS_MAX * sizeof(struct
pthread_specific_elem) is 3K (it actually spans whole page due to
padding), but I believe it is more acceptable than additional code for
specialized allocator().

The alternatives would either to make the specific data array be part of
the struct thread, or use internal bindings to call the libc malloc,
avoiding interposing.

Also do the style pass over the thr_spec.c, esp. simplify the
conditionals nesting by returning early when an error detected.
Remove trivial comments.

Found by: yuri@rawbw.com
PR: 200138
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoOn amd64, make proc0 pmap initialization slightly more correct. In
kib [Fri, 15 May 2015 08:30:29 +0000 (08:30 +0000)]
On amd64, make proc0 pmap initialization slightly more correct.  In
particular, switch to the proc0 pmap to have expected %cr3 and PCID
for the thread0 during initialization, and the up to date pm_active
mask.

pmap_pinit0() should be done after proc0->p_vmspace is assigned so
that the amd64 pmap_activate() find the correct curproc pmap.

Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoImplement the support for PCID in UP kernels.
kib [Fri, 15 May 2015 07:57:47 +0000 (07:57 +0000)]
Implement the support for PCID in UP kernels.

Requested by: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoRight now, the process' p_boundary_count counter is decremented by the
kib [Fri, 15 May 2015 07:54:31 +0000 (07:54 +0000)]
Right now, the process' p_boundary_count counter is decremented by the
suspended thread itself, on the return path from
thread_suspend_check().  A consequence is that return from
thread_single_end(SINGLE_BOUNDARY) may leave p_boundary_count
non-zero, it might be even equal to the threads count.

Now, assume that we have two threads in the process, both calling
execve(2).  Suppose that the first thread won the race to be the
suspension thread, and that afterward its exec failed for any reason.
After the first thread did thread_single_end(SINGLE_BOUNDARY), second
thread becomes the process suspension thread and checks
p_boundary_count.  The non-zero value of the count allows the
suspension loop to finish without actually suspending some threads.
In other words, we enter exec code with some threads not suspended.

Fix this by decrementing p_boundary_count in the
thread_single_end()->thread_unsuspend_one() during marking the thread
as runnable.  This way, a return from thread_single_end() guarantees
that the counter is cleared.  We do not care whether the unsuspended
thread has a chance to run.

Add some asserts to ensure the state of the process when single
boundary suspension is lifted.  Also make thread_unuspend_one()
static.

In collaboration with: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agosfxge: split sfxge_tx_qdpl_put() into *_locked() and *_unlocked()
arybchik [Fri, 15 May 2015 06:50:59 +0000 (06:50 +0000)]
sfxge: split sfxge_tx_qdpl_put() into *_locked() and *_unlocked()

It simplifies understanding of the sfxge_tx_packet_add() logic and
avoids passing of 'locked' to called function.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2547

9 years agosfxge: do not change CSUM_TSO when IFCAP_TSOx is changed
arybchik [Fri, 15 May 2015 06:49:43 +0000 (06:49 +0000)]
sfxge: do not change CSUM_TSO when IFCAP_TSOx is changed

It is simply not required since the kernel checks corresponding
IFCAP_TSOx capability and CSUM_TSO in hw-assisted offloads.
Note that CSUM_TSO is two bits (CSUM_IP_TSO|CSUM_IP6_TSO) and both bits
are set in IPv4 and IPv6 mbufs.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2546

9 years agosfxge: LRO may be done only if checksums are OK
arybchik [Fri, 15 May 2015 06:48:36 +0000 (06:48 +0000)]
sfxge: LRO may be done only if checksums are OK

Also it is cheaper to check Rx descriptor flags than TCP protocol in IP
header.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2542

9 years agoFree vsi->queues after use.
araujo [Fri, 15 May 2015 06:11:47 +0000 (06:11 +0000)]
Free vsi->queues after use.

Differential Revision: D2344
Reviewed by: erj

9 years agoIt appears to be armv7_sleep is a duplication of armv7_cpu_sleep.
ganbold [Fri, 15 May 2015 00:39:51 +0000 (00:39 +0000)]
It appears to be armv7_sleep is a duplication of armv7_cpu_sleep.
For consistency with the naming conventions used by the other
implementations kill armv7_sleep and keep armv7_cpu_sleep.

Differential Revision: https://reviews.freebsd.org/D2537
Submitted by: John Wehle
Reviewed by: ian@, andrew@

9 years agoMFV r282927,r282928,r282930 (kientzle):
delphij [Thu, 14 May 2015 22:35:26 +0000 (22:35 +0000)]
MFV r282927,r282928,r282930 (kientzle):

Don't segfault when reading malformed cpio archives.

MFC after: 3 days

9 years agoBump the size of the blockif scatter-gather list to 67.
grehan [Thu, 14 May 2015 21:08:48 +0000 (21:08 +0000)]
Bump the size of the blockif scatter-gather list to 67.

The Windows virtio driver ignores the advertized seg_max
field and assumes the host can accept up to 67 segments
in indirect descriptors, triggering an assert in the bhyve
process.

No objection from: mav
Reviewed by: neel
Reported and tested by: Leon Dang (ldang@nahannisys.com)
MFC after: 2 weeks

9 years agoAdd nvme and nvd drivers to GENERIC for amd64 and i386.
jimharris [Thu, 14 May 2015 20:19:22 +0000 (20:19 +0000)]
Add nvme and nvd drivers to GENERIC for amd64 and i386.

MFC after: 3 days
Sponsored by: Intel

9 years agovtfontcvt: Allow 6 digits in verbose output
emaste [Thu, 14 May 2015 20:17:53 +0000 (20:17 +0000)]
vtfontcvt: Allow 6 digits in verbose output

Some fonts (e.g. GNU Unifont) have more than 100,000 (half-)glyphs.

Sponsored by: The FreeBSD Foundation

9 years agoUpdate to ELF Tool Chain r3197
emaste [Thu, 14 May 2015 19:48:15 +0000 (19:48 +0000)]
Update to ELF Tool Chain r3197

Highlights:
 - Fix man page markup, whitespace, and typos
 - Fix sh_info of SHT_GROUP section to point to the correct string
 - Improve validation in readelf and elfcopy/strip
 - Handle DWARF 4's DW_AT_high_pc in addr2line

Sponsored by: The FreeBSD Foundation

9 years agoAdd ELF machine EM_IAMCU, 32-bit Intel MCU
emaste [Thu, 14 May 2015 18:29:05 +0000 (18:29 +0000)]
Add ELF machine EM_IAMCU, 32-bit Intel MCU

It is e_machine 6, which was previously reserved for 486.

9 years agokbdmap(1): Correct menu title: keyboards have a layout, not a language
emaste [Thu, 14 May 2015 18:09:56 +0000 (18:09 +0000)]
kbdmap(1): Correct menu title: keyboards have a layout, not a language

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

9 years agolibyaml.so.1 are actually libraries and should only be removed during
bapt [Thu, 14 May 2015 17:49:01 +0000 (17:49 +0000)]
libyaml.so.1 are actually libraries and should only be removed during
make delete-old-libs

Reported by: rpaulo

9 years agoObsoleteFiles: add lib32 entries for libyaml missed in r262407.
rpaulo [Thu, 14 May 2015 17:37:10 +0000 (17:37 +0000)]
ObsoleteFiles: add lib32 entries for libyaml missed in r262407.

Pointy hat: bapt

9 years agoAdd fabs() to arm64 libc
emaste [Thu, 14 May 2015 17:12:45 +0000 (17:12 +0000)]
Add fabs() to arm64 libc

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2532

9 years agonetfront: wait for backend to connect before sending ARP
royger [Thu, 14 May 2015 16:29:11 +0000 (16:29 +0000)]
netfront: wait for backend to connect before sending ARP

Netfront has to wait for the backend to switch to state XenbusStateConnected
before sending the ARP request, or else the backend might not be connected
and thus the packet will be lost.

Sponsored by: Citrix Systems R&D
MFC after: 1 week

9 years agoAdd new __unreachable() builtin
pfg [Thu, 14 May 2015 15:49:48 +0000 (15:49 +0000)]
Add new __unreachable() builtin

This is one of the few post gcc4.2 builtins that has been implemented by
clang:

__builtin_unreachable is used to indicate that a specific point in the
program cannot be reached, even if the compiler might otherwise think it
can. This is useful to improve optimization and eliminates certain
warnings.

Hinted by: NetBSD
Differential Revision: https://reviews.freebsd.org/D2536

9 years agoAllow sizeof(cpuset_t) to be queried in capability mode.
jonathan [Thu, 14 May 2015 15:14:03 +0000 (15:14 +0000)]
Allow sizeof(cpuset_t) to be queried in capability mode.

This allows functions that retrieve and inspect pthread_attr_t objects to
work correctly: querying the cpuset_t size is part of querying CPU
affinity information, which is part of creating a complete pthread_attr_t.

Approved by: rwatson (mentor)
Reviewed by: pjd
Sponsored by: NSERC

9 years agoRestore 'he' language code for Hebrew kbdmap(1) menu title
emaste [Thu, 14 May 2015 14:40:01 +0000 (14:40 +0000)]
Restore 'he' language code for Hebrew kbdmap(1) menu title

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

9 years agokbdmap(1): increase description size to 256 bytes
emaste [Thu, 14 May 2015 14:20:50 +0000 (14:20 +0000)]
kbdmap(1): increase description size to 256 bytes

After conversion to UTF-8 some INDEX.keymaps descriptions are longer
than the previous limit of 64 bytes.

PR: 193656
Sponsored by: The FreeBSD Foundation

9 years agosfxge: advertise IPv6 Rx and Tx checksum offload support
arybchik [Thu, 14 May 2015 14:16:09 +0000 (14:16 +0000)]
sfxge: advertise IPv6 Rx and Tx checksum offload support

Tx checksum offload may be enabled/disabled.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2543

9 years agoCorrect language code -- "Danish" is English
emaste [Thu, 14 May 2015 14:07:44 +0000 (14:07 +0000)]
Correct language code -- "Danish" is English

The menu entry "Danish ISO-8859-1 (macbook)" was first added to the
syscons(4) INDEX.keymaps in r241851 with no language code, and then in
r256367 incorrectly tagged with "da".  It is a Danish keyboard map, but
the description is in English and therefore must be "en".

This error subsequently propagated into the vt(4) INDEX.keymaps.

PR: 146793, 193656
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

9 years agoBuild GENERIC with RACCT/RCTL support by default. Note that it still
trasz [Thu, 14 May 2015 14:03:55 +0000 (14:03 +0000)]
Build GENERIC with RACCT/RCTL support by default.  Note that it still
needs to be enabled by adding "kern.racct.enable=1" to /boot/loader.conf.

Differential Revision: https://reviews.freebsd.org/D2407
Reviewed by: emaste@, wblock@
MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation

9 years agosfxge: IPv4 Tx checksum offload may be disabled in fact
arybchik [Thu, 14 May 2015 13:49:00 +0000 (13:49 +0000)]
sfxge: IPv4 Tx checksum offload may be disabled in fact

Split IFCAP_HWCSUM to IFCAP_RXCSUM and IFCAP_TXCSUM to highlight Tx and Rx.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2541

9 years agosfxge: add local variable with Rx descriptor flags
arybchik [Thu, 14 May 2015 13:28:29 +0000 (13:28 +0000)]
sfxge: add local variable with Rx descriptor flags

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

9 years agoCorrect UTF-8 encoding in Británico
emaste [Thu, 14 May 2015 13:27:24 +0000 (13:27 +0000)]
Correct UTF-8 encoding in Británico

One á was ISO 8859-1 0xE1 instead of UTF-8 0xC3 0xA1.

9 years agosfxge: add missing const qualifier to sfxge_link_mode
arybchik [Thu, 14 May 2015 12:59:17 +0000 (12:59 +0000)]
sfxge: add missing const qualifier to sfxge_link_mode

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

9 years agoRemove OUTPUT_FORMAT from theARM EFI linker script, it breaks building
andrew [Thu, 14 May 2015 12:43:39 +0000 (12:43 +0000)]
Remove OUTPUT_FORMAT from theARM EFI linker script, it breaks building
for big-endian arm.

9 years agowhois: add an option to query the PeeringDB
fanf [Thu, 14 May 2015 11:37:36 +0000 (11:37 +0000)]
whois: add an option to query the PeeringDB

9 years agoUpdate whois(1) synopsis.
fanf [Thu, 14 May 2015 11:33:31 +0000 (11:33 +0000)]
Update whois(1) synopsis.