]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoUpdate nvi to 2.1.3 which fixes the data corruption when locale conversion
bapt [Fri, 10 Apr 2015 17:50:28 +0000 (17:50 +0000)]
Update nvi to 2.1.3 which fixes the data corruption when locale conversion
failed

9 years agoFor reasons that I am not understand yet, using the libmd version of
delphij [Fri, 10 Apr 2015 17:21:47 +0000 (17:21 +0000)]
For reasons that I am not understand yet, using the libmd version of
SHA256 would make libarchive based application to give:

archive_read_extract(): Lzma library error: Corrupted input data

(Internally this is LZMA_DATA_ERR)

However, the libmd version of SHA256 is supposed to give same result
as the bundled version do, and xz(1) is not affected.

As a precaution, revert the SHA256 portion of r281316 for now until
we figure out why it breaks libarchive interoperability as we can't
yet rule out this change have introduced an ABI breakage.

9 years agoUse OF_getencpropalloc() to handle endianess of the properties.
ian [Fri, 10 Apr 2015 13:50:57 +0000 (13:50 +0000)]
Use OF_getencpropalloc() to handle endianess of the properties.

Submitted by: Michal Meloun

9 years agoAdd a pmap_kremove_device() to undo mappings made with pmap_kenter_device().
ian [Fri, 10 Apr 2015 13:26:35 +0000 (13:26 +0000)]
Add a pmap_kremove_device() to undo mappings made with pmap_kenter_device().

Previously we used pmap_kremove(), but with ARM_NEW_PMAP it does the remove
in a way that isn't SMP-coherent (which is appropriate in some circumstances
such as mapping/unmapping sf buffers).  With matching enter/remove routines
for device mappings, each low-level implementation can do the right thing.

Reviewed by: Svatopluk Kraus <onwahe@gmail.com>

9 years agoImport nvi 2.1.3
bapt [Fri, 10 Apr 2015 13:26:05 +0000 (13:26 +0000)]
Import nvi 2.1.3

Approved by: peter

9 years agoThe "get latency" and "get bitmode" device commands are read operations,
ian [Fri, 10 Apr 2015 13:20:31 +0000 (13:20 +0000)]
The "get latency" and "get bitmode" device commands are read operations,
not writes.

9 years agoRedo r274966. Instead of global all-interface all-vnet undocumented sysctl,
glebius [Fri, 10 Apr 2015 09:50:13 +0000 (09:50 +0000)]
Redo r274966. Instead of global all-interface all-vnet undocumented sysctl,
use per-interface flag, and document it.

Sponsored by: Nginx, Inc.

9 years agoUse _exit, not exit in forked process
ngie [Fri, 10 Apr 2015 09:37:53 +0000 (09:37 +0000)]
Use _exit, not exit in forked process

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

9 years agoRemove argc/argv (-Wunused)
ngie [Fri, 10 Apr 2015 09:27:23 +0000 (09:27 +0000)]
Remove argc/argv (-Wunused)

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

9 years agoFix warnings
ngie [Fri, 10 Apr 2015 09:26:21 +0000 (09:26 +0000)]
Fix warnings

- Remove argc/argv (-Wunused)
- Mark some parameters to socket_listen_update __unused (-Wunused)

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

9 years agoRemove argc/argv (-Wunused)
ngie [Fri, 10 Apr 2015 09:23:00 +0000 (09:23 +0000)]
Remove argc/argv (-Wunused)

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

9 years ago- Parameterize out the number of accept/connect attempts
ngie [Fri, 10 Apr 2015 09:21:07 +0000 (09:21 +0000)]
- Parameterize out the number of accept/connect attempts
- Randomize the bind port to allow 2+ consecutive calls in < 10 minutes, and
  to also not fail if (for instance) there's a server already listening on port
  8080
- Don't leak the listening socket / fds into the child process
- Fix warnings:
-- Remove argc/argv (-Wunused)
-- Mark sig __unused (-Wunused)
-- Mark quit static (-Wmissing-variable-declarations)

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

9 years agoPort the EFI reloc codeto work on arm64. This used the rela relocation
andrew [Fri, 10 Apr 2015 09:15:35 +0000 (09:15 +0000)]
Port the EFI reloc codeto work on arm64. This used the rela relocation
table so wiill need the addend included in the relocation calculation.

Sponsored by: The FreeBSD Foundation

9 years agoFix -Wunused warnings, bump WARNS to 6
ngie [Fri, 10 Apr 2015 08:01:49 +0000 (08:01 +0000)]
Fix -Wunused warnings, bump WARNS to 6

The output is still broken if prove -rv is run and the testcase aborts
prematurely with fail_assertion (the testcase doesn't really conform to TAP
protocol properly, except when it completes fully)

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

9 years agoFix -Wunused warnings, bump WARNS to 6
ngie [Fri, 10 Apr 2015 07:59:46 +0000 (07:59 +0000)]
Fix -Wunused warnings, bump WARNS to 6

The testcase fails today on subtest # 9

The output is still broken if prove -rv is run and the testcase aborts
prematurely (the testcase doesn't really conform to TAP protocol properly,
except when it completes fully)

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

9 years agoFix warnings, fix a typo in a testcase description, bump WARNS to 3
ngie [Fri, 10 Apr 2015 07:35:53 +0000 (07:35 +0000)]
Fix warnings, fix a typo in a testcase description, bump WARNS to 3

- Remove argc/argv (-Wunused)
- Cast len in comparison to size_t (-Wsign-compare)

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

9 years agoUMA zone limit can be lowered, so remove protection against from
glebius [Fri, 10 Apr 2015 06:56:49 +0000 (06:56 +0000)]
UMA zone limit can be lowered, so remove protection against from
the sysctl_handle_uma_zone_max().

Sponsored by: Nginx, Inc.

9 years agoo Use Jenkins hash. With previous hash, for a single source IP address and
glebius [Fri, 10 Apr 2015 06:55:43 +0000 (06:55 +0000)]
o Use Jenkins hash. With previous hash, for a single source IP address and
  sequential IP ID case (e.g. ping -f), distribution fell into 8-10 buckets
  out of 64. With Jenkins hash, distribution is even.
o Add random seed to the hash.

Sponsored by: Nginx, Inc.

9 years agoMove all code related to IP fragment reassembly to ip_reass.c. Some
glebius [Fri, 10 Apr 2015 06:02:37 +0000 (06:02 +0000)]
Move all code related to IP fragment reassembly to ip_reass.c.  Some
function names have changed and comments are reformatted or added, but
there is no functional change.

Claim copyright for me and Adrian.

Sponsored by: Nginx, Inc.

9 years ago- Fix support with new elftoolchain readelf(1)
bdrewery [Thu, 9 Apr 2015 22:16:35 +0000 (22:16 +0000)]
- Fix support with new elftoolchain readelf(1)
- Fix not finding global symbols by checking for D and R.
- Follow symlinks
- Show which matching symbol was used to consider the library needed.

Discussed with: bapt

9 years agoNow that IP reassembly is no longer under single lock, book-keeping amount
glebius [Thu, 9 Apr 2015 22:13:27 +0000 (22:13 +0000)]
Now that IP reassembly is no longer under single lock, book-keeping amount
of allocations in V_nipq is racy.  To fix that, we would simply stop doing
book-keeping ourselves, and rely on UMA doing that.  There could be a
slight overcommit due to caches, but that isn't a big deal.

o V_nipq and V_maxnipq go away.
o net.inet.ip.fragpackets is now just SYSCTL_UMA_CUR()
o net.inet.ip.maxfragpackets could have been just SYSCTL_UMA_MAX(), but
  historically it has special semantics about values of 0 and -1, so
  provide sysctl_maxfragpackets() to handle these special cases.
o If zone limit lowers either due to net.inet.ip.maxfragpackets or due to
  kern.ipc.nmbclusters, then new function ipq_drain_tomax() goes over
  buckets and frees the oldest packets until we are in the limit.
  The code that (incorrectly) did that in ip_slowtimo() is removed.
o ip_reass() doesn't check any limits and calls uma_zalloc(M_NOWAIT).
  If it fails, a new function ipq_reuse() is called. This function will
  find the oldest packet in the currently locked bucket, and if there is
  none, it will search in other buckets until success.

Sponsored by: Nginx, Inc.

9 years agortsold does not need to link to libkvm
bapt [Thu, 9 Apr 2015 21:52:14 +0000 (21:52 +0000)]
rtsold does not need to link to libkvm

9 years agorpc.locked does not need to link to libutil
bapt [Thu, 9 Apr 2015 21:48:17 +0000 (21:48 +0000)]
rpc.locked does not need to link to libutil

9 years agobhyvectl does not need to link to libutil
bapt [Thu, 9 Apr 2015 21:39:58 +0000 (21:39 +0000)]
bhyvectl does not need to link to libutil

9 years agoFix overlinking in bhyve:
bapt [Thu, 9 Apr 2015 21:38:40 +0000 (21:38 +0000)]
Fix overlinking in bhyve:

libvmmapi is actually needed to be linked to libutil, not bhyve nor bhyveload

9 years agoDon't enable RX and TX before their initial configuration is done, i. e.
marius [Thu, 9 Apr 2015 21:35:44 +0000 (21:35 +0000)]
Don't enable RX and TX before their initial configuration is done, i. e.
after setting up interrupt moderation but before turning interrupts on.
This matches what Realtek's r8168 Linux driver does as of version 8.039.00
and fixes problems with certain incarnations of certain MAC revisions
like the interface requiring an extra up/down-cycle after boot to start
working or DMA configuration not being adhered to.

PR: 193743, 197535
MFC after: 1 week

9 years agoauthpf does not need to link to libmd
bapt [Thu, 9 Apr 2015 21:33:57 +0000 (21:33 +0000)]
authpf does not need to link to libmd

9 years agoPrint 64-bit addresses cleary with leading zeros to avoid confusions.
jkim [Thu, 9 Apr 2015 21:32:40 +0000 (21:32 +0000)]
Print 64-bit addresses cleary with leading zeros to avoid confusions.

MFC after: 1 week

9 years agoIn the ip_reass() do packet examination and adjusting before acquiring
glebius [Thu, 9 Apr 2015 21:32:32 +0000 (21:32 +0000)]
In the ip_reass() do packet examination and adjusting before acquiring
locks and doing lookups.

Sponsored by: Nginx, Inc.

9 years agoRemove uneeded link to libkiconv
bapt [Thu, 9 Apr 2015 21:30:11 +0000 (21:30 +0000)]
Remove uneeded link to libkiconv

9 years agoConvert mt(1) and libmt to LIBADD
bapt [Thu, 9 Apr 2015 21:26:38 +0000 (21:26 +0000)]
Convert mt(1) and libmt to LIBADD

While here fix missing link to libbsdxml for libmt
Fix overlinking in mt(1)
Make add an indirect libmt dependency on bsdxml to allow static linking if
needed

9 years agoDo not crash when RSDT/XSDT contains an empty entry.
jkim [Thu, 9 Apr 2015 21:26:23 +0000 (21:26 +0000)]
Do not crash when RSDT/XSDT contains an empty entry.

Reported by: Slawa Olhovchenkov <slw@zxy.spb.ru>
MFC after: 3 days

9 years agoRemove uneeded sbuf header
bapt [Thu, 9 Apr 2015 21:23:27 +0000 (21:23 +0000)]
Remove uneeded sbuf header

9 years agoMake ip reassembly queue mutexes per-vnet, putting them into the structure
glebius [Thu, 9 Apr 2015 21:17:07 +0000 (21:17 +0000)]
Make ip reassembly queue mutexes per-vnet, putting them into the structure
that they protect.

Sponsored by: Nginx, Inc.

9 years agoiscsictl(8) does not actually needs to be linked to libcam nor libutil
bapt [Thu, 9 Apr 2015 21:14:40 +0000 (21:14 +0000)]
iscsictl(8) does not actually needs to be linked to libcam nor libutil

9 years agoConvert cftmerge to LIBADD and remove link on libdwarf which is not needed
bapt [Thu, 9 Apr 2015 21:08:21 +0000 (21:08 +0000)]
Convert cftmerge to LIBADD and remove link on libdwarf which is not needed

9 years agobsnmptools does not depends on libcrypto
bapt [Thu, 9 Apr 2015 21:05:48 +0000 (21:05 +0000)]
bsnmptools does not depends on libcrypto

9 years ago- ggatel.8 currently doesn't mention the 'rescue' command and
jgh [Thu, 9 Apr 2015 20:58:38 +0000 (20:58 +0000)]
- ggatel.8 currently doesn't mention the 'rescue' command and
  documents a non-existing 'attach' command instead.
- while here address a spelling error

PR: 199111
Differential Revision: https://reviews.freebsd.org/D2259
Submitted by: fk@fabiankeil.de
Obtained from: ElectroBSD
Approved by: wblock (mentor)
MFC after: 1 week

9 years agoRemove EOL whitespace from i386 EFI loader source
emaste [Thu, 9 Apr 2015 19:48:42 +0000 (19:48 +0000)]
Remove EOL whitespace from i386 EFI loader source

9 years agoUpdate documented OEM string in newfs_msdos(8).
pfg [Thu, 9 Apr 2015 19:07:01 +0000 (19:07 +0000)]
Update documented OEM string in newfs_msdos(8).

This was updated in r203868 to better match the naming scheme
in other OSs that use FAT.

MFC after: 3 days

9 years agoMFV r281278:
delphij [Thu, 9 Apr 2015 18:03:27 +0000 (18:03 +0000)]
MFV r281278:

 - Update xz to 5.2.1, where the most visible change is that it
   fixed a compression-ratio regression in fast mode LZMA1 and
   LZMA2 and used cpuset_getaffinity() for CPU cores detection.
 - Make liblzma use the base system SHA256 implementation instead of
   the bundled one.
 - Additional annotation in config.h for FreeBSD specific tweaks.
 - Refresh symbols in XZprivate_1.0 to reflect reality.

Relnotes: yes
MFC after: 1 month (TBD)

9 years agoAvoid escaping EOL for line continuation
emaste [Thu, 9 Apr 2015 15:08:39 +0000 (15:08 +0000)]
Avoid escaping EOL for line continuation

Reported by: kib

9 years agoRevert 281276 as unnecessary. Proper change to be committed
gnn [Thu, 9 Apr 2015 14:44:30 +0000 (14:44 +0000)]
Revert 281276 as unnecessary.  Proper change to be committed
to the base polling code in a subsequent commit.

Pointed out by: glebius

Sponsored by: Rubicon Communications (NetGate)

9 years agoar: Disallow directory traversal
emaste [Thu, 9 Apr 2015 13:45:17 +0000 (13:45 +0000)]
ar: Disallow directory traversal

Set ARCHIVE_EXTRACT_SECURE_SYMLINKS and ARCHIVE_EXTRACT_SECURE_NODOTDOT
as in bsdtar to prevent extraction of archive entries whose pathnames
contain .. or whose target directory would be altered by a symlink.
Also disallow absolute pathnames.

We don't currently provide an option to disable this behaviour (as
bsdtar's -P does). It is unlikely to be a problem in practice for ar(1),
but the -P option is not currently used and available if we want to
consider it for this purpose.

Differential Revision: https://reviews.freebsd.org/D1524
Reported by: Alexander Cherepanov <cherepan@mccme.ru>
Approved by: delphij
Obtained from: ELF tool chain ar, Ticket #474
MFC after: 1 week
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

9 years agoRemove sleeps from geom_up thread on device destruction.
mav [Thu, 9 Apr 2015 13:09:05 +0000 (13:09 +0000)]
Remove sleeps from geom_up thread on device destruction.

MFC after: 3 days.

9 years agoFix the check for maximum mbuf's size needed to send ND6 NA and NS.
ae [Thu, 9 Apr 2015 12:57:58 +0000 (12:57 +0000)]
Fix the check for maximum mbuf's size needed to send ND6 NA and NS.
It is acceptable that the size can be equal to MCLBYTES. In the later
KAME's code this check has been moved under DIAGNOSTIC ifdef, because
the size of NA and NS is much smaller than MCLBYTES. So, it is safe to
replace the check with KASSERT.

PR: 199304
Discussed with: glebius
MFC after: 1 week

9 years agoAdd R_AARCH64_NONE, the null relocation.
andrew [Thu, 9 Apr 2015 10:28:05 +0000 (10:28 +0000)]
Add R_AARCH64_NONE, the null relocation.

9 years agoPrint error values with hex to make it easier to find the EFI error type.
andrew [Thu, 9 Apr 2015 10:15:47 +0000 (10:15 +0000)]
Print error values with hex to make it easier to find the EFI error type.

9 years agoOnly use -fPIC when building boot1.efi for x86.
andrew [Thu, 9 Apr 2015 10:08:10 +0000 (10:08 +0000)]
Only use -fPIC when building boot1.efi for x86.

Sponsored by: The FreeBSD Foundation

9 years agoAdd the arm64 machine dependent parts of ficl. This is not machine
andrew [Thu, 9 Apr 2015 10:00:26 +0000 (10:00 +0000)]
Add the arm64 machine dependent parts of ficl. This is not machine
dependent, as most copies of these files are identical, but unfortunately
this is still needed.

Sponsored by: The FreeBSD Foundation

9 years agoUse TAILQ_FOREACH_SAFE() instead of implementing it ourselves.
glebius [Thu, 9 Apr 2015 09:00:32 +0000 (09:00 +0000)]
Use TAILQ_FOREACH_SAFE() instead of implementing it ourselves.

Sponsored by: Nginx, Inc.

9 years agoIf V_maxnipq is set to zero, drain the queue here and now, instead of
glebius [Thu, 9 Apr 2015 08:56:23 +0000 (08:56 +0000)]
If V_maxnipq is set to zero, drain the queue here and now, instead of
relying on timeouts.

Sponsored by: Nginx, Inc.

9 years agoo Since we always update either fragdrop or fragtimeout stat counter when we
glebius [Thu, 9 Apr 2015 08:52:02 +0000 (08:52 +0000)]
o Since we always update either fragdrop or fragtimeout stat counter when we
  free a fragment, provide two inline functions that do that for us:
  ipq_drop() and ipq_timeout().
o Rename ip_free_f() to ipq_free() to match the name scheme of IP reassembly.
o Remove assertion from ipq_free(), since it requires extra argument to be
  passed, but locking scheme is simple enough and function is static.

Sponsored by: Nginx, Inc.

9 years agoRename ip_drain_locked() to ip_drain_vnet(), since the function differs
glebius [Thu, 9 Apr 2015 08:37:16 +0000 (08:37 +0000)]
Rename ip_drain_locked() to ip_drain_vnet(), since the function differs
from ip_drain() not in locking, but in the scope of its work.

Sponsored by: Nginx, Inc.

9 years agoRemove debugging code that sneaked in.
glebius [Thu, 9 Apr 2015 07:52:03 +0000 (07:52 +0000)]
Remove debugging code that sneaked in.

9 years agoRemove 'netstat -anr' from crashinfo.
glebius [Thu, 9 Apr 2015 07:49:42 +0000 (07:49 +0000)]
Remove 'netstat -anr' from crashinfo.

9 years agoProvide a gdb script, that prints routing tables from a live kernel or a
glebius [Thu, 9 Apr 2015 07:45:30 +0000 (07:45 +0000)]
Provide a gdb script, that prints routing tables from a live kernel or a
core file, much like 'netstat -anr' does it for living kernel.

Right now only AF_INET routing table is printed. AF_INET6 needs to
be done. But the most difficult part of the script (recursion!) is
complete.

Sponsored by: Nginx, Inc.

9 years agoDo not access peripheral before clock stabilization.
adrian [Thu, 9 Apr 2015 04:56:24 +0000 (04:56 +0000)]
Do not access peripheral before clock stabilization.

Tested:

* Intel 3945ABG NIC, STA mode

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

9 years agoFix buffer overflow introduced in previous commits (unbreaks 802.11a capable NICs).
adrian [Thu, 9 Apr 2015 04:51:39 +0000 (04:51 +0000)]
Fix buffer overflow introduced in previous commits (unbreaks 802.11a capable NICs).

Tested:

* PCIe Intel 3945ABG NIC

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

9 years agonvme: use BUS_SPACE_MAXSIZE for bus_dma_tag_create maxsize parameter
jimharris [Thu, 9 Apr 2015 00:37:55 +0000 (00:37 +0000)]
nvme: use BUS_SPACE_MAXSIZE for bus_dma_tag_create maxsize parameter

This fixes i386 PAE build fallout from r281281.

Reported by: bz
MFC after: 1 week

9 years agonvme: remove CHATHAM related code
jimharris [Wed, 8 Apr 2015 21:52:06 +0000 (21:52 +0000)]
nvme: remove CHATHAM related code

Chatham was an internal NVMe prototype board used for
early driver development.

MFC after: 1 week
Sponsored by: Intel

9 years agonvme: add device strings for Intel DC series NVMe SSDs
jimharris [Wed, 8 Apr 2015 21:50:45 +0000 (21:50 +0000)]
nvme: add device strings for Intel DC series NVMe SSDs

MFC after: 1 week
Sponsored by: Intel

9 years agonvme: create separate DMA tag for non-payload DMA buffers
jimharris [Wed, 8 Apr 2015 21:49:45 +0000 (21:49 +0000)]
nvme: create separate DMA tag for non-payload DMA buffers

Submission and completion queue memory need to use a
separate DMA tag for mappings than payload buffers,
to ensure mappings remain contiguous even with DMAR
enabled.

Submitted by: kib
MFC after: 1 week
Sponsored by: Intel

9 years agonvme: fall back to a smaller MSI-X vector allocation if necessary
jimharris [Wed, 8 Apr 2015 21:46:18 +0000 (21:46 +0000)]
nvme: fall back to a smaller MSI-X vector allocation if necessary

Previously, if per-CPU MSI-X vectors could not be allocated,
nvme(4) would fall back to INTx with a single I/O queue pair.
This change will still fall back to a single I/O queue pair, but
allocate MSI-X vectors instead of reverting to INTx.

MFC after: 1 week
Sponsored by: Intel

9 years agoAdd support for a netisr polling tunable, which allows run time switching of
gnn [Wed, 8 Apr 2015 20:25:51 +0000 (20:25 +0000)]
Add support for a netisr polling tunable, which allows run time switching of
device polling rather than having it only be controlled by the compile
time option.

Summary: Rubicon Communications (Netgate)

Reviewers: #network, hiren

Reviewed By: #network, hiren

Subscribers: hiren

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

9 years agoRe-do proper mode-endings. Antithesis of r281176-281179 which reverted
dteske [Wed, 8 Apr 2015 20:10:42 +0000 (20:10 +0000)]
Re-do proper mode-endings. Antithesis of r281176-281179 which reverted
earlier migration away from sloppy mode-endings (r280925,280974-280976)
due to a red-herring in diagnosing HardenedBSD boot lockup.

Thanks to: lattera (shawn.webb@hardenedbsd<dot>org)
MFC after: 3 days
X-MFC-to: stable/10
X-MFC-with: r280925,280974-280976,281176-281179

9 years agoExplain that vm_page_array is mapped to describe the memory, not the
kib [Wed, 8 Apr 2015 19:46:13 +0000 (19:46 +0000)]
Explain that vm_page_array is mapped to describe the memory, not the
memory itself.  Provide the formula to calculate the number of
required page tables.  Correct the size of the struct vm_page for
non-PAE case.

Reviewed by: alc, jhb (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoFix a bootlock condition if/when loader_logo is set in loader.conf(5)
dteske [Wed, 8 Apr 2015 19:12:38 +0000 (19:12 +0000)]
Fix a bootlock condition if/when loader_logo is set in loader.conf(5)
NB: This deeply effected HardenedBSD which had a default value set.

Embarassingly, I allowed the `type' primitive to be passed -1/-1 for
c-addr/u stack input (the effect of which is to pull INT_MAX bytes
from character address negative one in which hilarity ensues over a
black screen in full-on bootlock). Much thanks to Shawn Webb [lattera]
for helping me diagnose.

NB: The mode-ending revisions were initially suspected (and reverted)
but proved to be a red-herring. Proper mode endings will be returning.

Thanks to: lattera (@HardenedBSD [<dot><com>])
Reported by: lattera
MFC after: 3 days
X-MFC-to: stable/10

9 years agocompiler-rt: include 128-bit quad precision fp support only on arm64
emaste [Wed, 8 Apr 2015 19:07:06 +0000 (19:07 +0000)]
compiler-rt: include 128-bit quad precision fp support only on arm64

Other architectures do not use quad precision long double and don't need
these runtime support routines.

Differential Revision: https://reviews.freebsd.org/D2252
Reviewed by: dim
Sponsored by: The FreeBSD Foundation

9 years agoMove the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h>
jhb [Wed, 8 Apr 2015 16:30:45 +0000 (16:30 +0000)]
Move the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h>
and export them to userland.
- Define __HAVE_REG32 on platforms that define a reg32 structure and check
  for this in <sys/procfs.h> to control when to export prstatus32, etc.
- Add prstatus32_t and prpsinfo32_t typedefs for the 32-bit structures.
  libbfd looks for these types, and having them fixes 'gcore' in gdb of a
  32-bit process on a 64-bit platform.
- Use the structure definitions from <sys/procfs.h> in gcore's elf32 core
  dump code instead of duplicating the definitions.

Differential Revision: https://reviews.freebsd.org/D2142
Reviewed by: kib, nathanw (powerpc bits)
MFC after: 1 week

9 years agoAdd a hint that "device ctl" kind of depends on "device iscsi".
trasz [Wed, 8 Apr 2015 11:59:00 +0000 (11:59 +0000)]
Add a hint that "device ctl" kind of depends on "device iscsi".

It actually doesn't - "device ctl" automatically pulls in ICL, which
would normally be a part of iscsi.ko.  However, doing it that way makes
iscsi.ko unloadable, and building ctl.ko without iscsi.ko (using
MODULES_OVERRIDE) results in ctl.ko that is unloadable, due to missing
symbols that would be resolved to iscsi.ko.  And since the symbols
are named "icl_whatever", it's not obvious that it's iscsi.ko that's
required.

If there is a better way - let me know.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoClean up printtrap a little.
jhibbits [Wed, 8 Apr 2015 04:37:11 +0000 (04:37 +0000)]
Clean up printtrap a little.

* Sort exceptions
* Add printing of ESR on book-e, and only print DSISR on AIM

9 years agoAdd DTrace support for Book-E PowerPC.
jhibbits [Wed, 8 Apr 2015 04:35:26 +0000 (04:35 +0000)]
Add DTrace support for Book-E PowerPC.

Book-E got DTrace support for free with r281096&related.  This adds the bits to
the db_trap_glue() to support FBT.

Relnotes: Yes

9 years agonewvers.sh: remove 'X' hack from shell script
eadler [Wed, 8 Apr 2015 04:01:02 +0000 (04:01 +0000)]
newvers.sh: remove 'X' hack from shell script

Reviewed by: allanjude,  Daniel O'Connor

9 years agoAdd a DTRACEFLAGS variable, which can be used to pass additional variables
markj [Wed, 8 Apr 2015 02:43:05 +0000 (02:43 +0000)]
Add a DTRACEFLAGS variable, which can be used to pass additional variables
to dtrace(1) invocations during a build. This change includes -C in the
default flags, which has dtrace(1) run input scripts through the
preprocessor. While here, sort the definitions of CP and CPP in sys.mk.

Differential Revision: https://reviews.freebsd.org/D2204
Reviewed by: imp, rpaulo (previous revision)

9 years agolibdtrace: add support for lazyload mode.
markj [Wed, 8 Apr 2015 02:36:37 +0000 (02:36 +0000)]
libdtrace: add support for lazyload mode.

Passing "-x lazyload" to dtrace -G during compilation causes dtrace(1) to
not link drti.o into the output object file, so the USDT probes are not created
during process startup. Instead, dtrace(1) will automatically discover and
create probes on the process' behalf when attaching.

Differential Revision: https://reviews.freebsd.org/D2203
Reviewed by: rpaulo
MFC after: 1 month

9 years agoAccount for the offset of the page run when allocating the
kib [Wed, 8 Apr 2015 01:55:22 +0000 (01:55 +0000)]
Account for the offset of the page run when allocating the
dmar_map_entry.  Non-zero offset both increases the required mapping
size, which is handled in dmar_bus_dmamap_load_something1(), and makes
it possible that allocated range crosses boundary, which needs a check
in dmar_gas_match_one().

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

9 years agoFix powerpc setjmp FPR saving/restoring.
jhibbits [Wed, 8 Apr 2015 00:32:39 +0000 (00:32 +0000)]
Fix powerpc setjmp FPR saving/restoring.

X-MFC-With: r279784

9 years agoUnbreak book-e, broken by the trap.c merge (missed this file).
jhibbits [Wed, 8 Apr 2015 00:31:33 +0000 (00:31 +0000)]
Unbreak book-e, broken by the trap.c merge (missed this file).

9 years agoMove the IPv4 reassembly queue locking from a single lock to be per-bucket (global).
adrian [Tue, 7 Apr 2015 23:09:34 +0000 (23:09 +0000)]
Move the IPv4 reassembly queue locking from a single lock to be per-bucket (global).

This significantly improves performance on multi-core servers where there
is any kind of IPv4 reassembly going on.

glebius@ would like to see the locking moved to be attached to the reassembly
bucket, which would make it per-bucket + per-VNET, instead of being global.
I decided to keep it global for now as it's the minimal useful change;
if people agree / wish to migrate it to be per-bucket / per-VNET then please
do feel free to do so.  I won't complain.

Thanks to Norse Corp for giving me access to much larger servers
to test this at across the 4 core boxes I have at home.

Differential Revision: https://reviews.freebsd.org/D2095
Reviewed by: glebius (initial comments incorporated into this patch)
MFC after: 2 weeks
Sponsored by: Norse Corp, Inc (hardware)

9 years agoAdd EFI boot1 for i386
emaste [Tue, 7 Apr 2015 21:41:26 +0000 (21:41 +0000)]
Add EFI boot1 for i386

loader.efi still needs work, but boot1.efi now builds.

Differential Revision: https://reviews.freebsd.org/D2244
Reviewed by: rpaulo
Sponsored by: The FreeBSD Foundation

9 years agoEFI: use common reloc.c for all architectures
emaste [Tue, 7 Apr 2015 21:34:49 +0000 (21:34 +0000)]
EFI: use common reloc.c for all architectures

Much of this file is common to the architectures we support, so share
an implementation by adding a little #ifdef-ery.

Differential Revision: https://reviews.freebsd.org/D2241
Reviewed by: imp
Sponsored by: The FreeBSD Foundation

9 years agoifmedia changes:
erj [Tue, 7 Apr 2015 21:31:17 +0000 (21:31 +0000)]
ifmedia changes:

- Extend the number of available subtypes for Ethernet media by using some
of the ifmedia word's option bits to help denote subtypes. As a result, the
number of possible Ethernet subtype values increases from 31 to 511.

- Use some of those new values to define new media types.

- lacp_compose_key() recgonizes the new Ethernet media types added.
  (Change made as required by a comment in if_media.h)

- New ioctl, SIOGIFXMEDIA, to handle getting the new extended media types.
  SIOCGIFMEDIA is retained for backwards compatibility.

- Changes to ifconfig to allow it to handle the new extended media types.

Submitted by: mike@karels.net (original), hselasky
Reviewed by: jfvogel, gnn, hselasky
Approved by: jfvogel (mentor), gnn (mentor)
Differential Revision: http://reviews.freebsd.org/D1965

9 years agoEvaluate packet size after the firewall had its chance
kp [Tue, 7 Apr 2015 20:29:03 +0000 (20:29 +0000)]
Evaluate packet size after the firewall had its chance

Defer the packet size check until after the firewall has had a look at it. This
means that the firewall now has the opportunity to (re-)fragment an oversized
packet.

Differential Revision: https://reviews.freebsd.org/D1815
Reviewed by: ae
Approved by: gnn (mentor)

9 years agoMitigate Local Denial of Service with IPv6 Router Advertisements
delphij [Tue, 7 Apr 2015 20:20:09 +0000 (20:20 +0000)]
Mitigate Local Denial of Service with IPv6 Router Advertisements
and log attack attempts.

Submitted by: hrs
Security: FreeBSD-SA-15:09.nd6
Security: CVE-2015-2923

9 years agoImprove patch for SA-15:04.igmp to solve a potential buffer overflow.
delphij [Tue, 7 Apr 2015 20:20:03 +0000 (20:20 +0000)]
Improve patch for SA-15:04.igmp to solve a potential buffer overflow.

Reported by: bde
Submitted by: oshogbo

9 years agoRevert r281220 and r281024, so that the new content added and its
hselasky [Tue, 7 Apr 2015 19:39:23 +0000 (19:39 +0000)]
Revert r281220 and r281024, so that the new content added and its
wording can be more properly discussed. Spelling fix made is kept.

Suggested by: gleb @
MFC after: 1 week

9 years agoAdd B_KVAALLOC and B_UNMAPPED to the buf flag name list.
markj [Tue, 7 Apr 2015 19:37:49 +0000 (19:37 +0000)]
Add B_KVAALLOC and B_UNMAPPED to the buf flag name list.

Differential Revision: https://reviews.freebsd.org/D1895
Submitted by: Conrad Meyer
MFC after: 1 week

9 years agocompiler-rt: add floatditf and floatunditf
emaste [Tue, 7 Apr 2015 19:31:29 +0000 (19:31 +0000)]
compiler-rt: add floatditf and floatunditf

These are long integer (di_int/du_int) to quad precision floating point
conversions. They may be reworked based on upstream discussion. These
versions are here to support arm64 world builds.

Reviewed by: ed
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2174

9 years agocompiler-rt: Implement multc3 - quad-precision complex multiplication
emaste [Tue, 7 Apr 2015 19:28:53 +0000 (19:28 +0000)]
compiler-rt: Implement multc3 - quad-precision complex multiplication

This may be reworked based on upstream discussion. This version is here
to support arm64 world builds.

Reviewed by: ed
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2173

9 years agoJust briefly mention about the dangers of non-random IP IDs.
hselasky [Tue, 7 Apr 2015 18:52:00 +0000 (18:52 +0000)]
Just briefly mention about the dangers of non-random IP IDs.
A full in depth explanation belongs somewhere else.

Suggested by: gleb @
MFC after: 1 week

9 years agopatch: Bring small updates from OpenBSD
pfg [Tue, 7 Apr 2015 18:06:46 +0000 (18:06 +0000)]
patch: Bring small updates from OpenBSD

Prevent null pointer dereference on empty input files when diff requires
a specific version.

Fix division by zero for files with long lines (> 1024) in Plan B mode
by supporting arbitrarily long lines.

Obtained from: OpenBSD (CVS Rev 1.41, 1.42)
MFC after: 1 week

9 years agoCheck l2cap socket initialisation and define L2CAP_SOCKET_CHECKED
takawata [Tue, 7 Apr 2015 16:48:23 +0000 (16:48 +0000)]
Check l2cap socket initialisation and define L2CAP_SOCKET_CHECKED
This will fix build.

9 years agoFix missing AUTHOR section for jot(1), rs(1), and lam(1)
allanjude [Tue, 7 Apr 2015 15:56:08 +0000 (15:56 +0000)]
Fix missing AUTHOR section for jot(1), rs(1), and lam(1)

PR: 196786
Differential Revision: https://reviews.freebsd.org/D2115
Submitted by: John A. Kunze (Author)
Approved by: wblock (mentor)
MFC after: 1 week
Sponsored by: ScaleEngine Inc.

9 years agoAdd a missing comma.
brueffer [Tue, 7 Apr 2015 15:32:25 +0000 (15:32 +0000)]
Add a missing comma.

Submitted by: danfe

9 years agoGet the fdt uart driver working on arm64, there is no machine/fdt.h, and
andrew [Tue, 7 Apr 2015 15:12:03 +0000 (15:12 +0000)]
Get the fdt uart driver working on arm64, there is no machine/fdt.h, and
the default shift should be 2 for the SoCs we support.

Sponsored by: The FreeBSD Foundation

9 years agoMake use of allocation attributes in system headers.
pfg [Tue, 7 Apr 2015 14:47:27 +0000 (14:47 +0000)]
Make use of allocation attributes in system headers.

Start using 'alloc_size' attribute in the allocator functions.
This is useful as it helps the compiler generate warnings on suspicious
code and can also enable some small optimizations.

This is based on r281130, which brought similar enhnacements
to the standard libc headers.

9 years agoThe code says "or", not "either or". So fix the documentation.
tuexen [Tue, 7 Apr 2015 14:33:03 +0000 (14:33 +0000)]
The code says "or", not "either or". So fix the documentation.

MFC after: 1 week

9 years agoWe will have fueword on arm64, mark as such in machine/param.h.
andrew [Tue, 7 Apr 2015 13:17:28 +0000 (13:17 +0000)]
We will have fueword on arm64, mark as such in machine/param.h.

Sponsored by: The FreeBSD Foundation

9 years agoFix uart_fdt_get_clock. It should have beed using the cell variable passed
andrew [Tue, 7 Apr 2015 12:42:06 +0000 (12:42 +0000)]
Fix uart_fdt_get_clock. It should have beed using the cell variable passed
in, not value on the stack.