]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoUse a consistent type for the number of HMAC algorithms.
tuexen [Tue, 16 Sep 2014 14:20:33 +0000 (14:20 +0000)]
Use a consistent type for the number of HMAC algorithms.
This fixes a bug which resulted in a warning on the userland
stack, when compiled on Windows.
Thanks to Peter Kasting from Google for reporting the issue and
provinding a potential fix.

MFC after: 3 days

9 years agoSmall cleanup which addresses a warning regaring the truncation
tuexen [Tue, 16 Sep 2014 13:48:46 +0000 (13:48 +0000)]
Small cleanup which addresses a warning regaring the truncation
of a 64-bit entity to a 32-bit entity. This issue was reported by
Peter Kasting from Google.

MFC after: 3 days

9 years agoFreeBSD-SA-14:19.tcp raised attention to the state of our stack
glebius [Tue, 16 Sep 2014 11:07:25 +0000 (11:07 +0000)]
FreeBSD-SA-14:19.tcp raised attention to the state of our stack
towards blind SYN/RST spoofed attack.

Originally our stack used in-window checks for incoming SYN/RST
as proposed by RFC793. Later, circa 2003 the RST attack was
mitigated using the technique described in P. Watson
"Slipping in the window" paper [1].

After that, the checks were only relaxed for the sake of
compatibility with some buggy TCP stacks. First, r192912
introduced the vulnerability, just fixed by aforementioned SA.
Second, r167310 had slightly relaxed the default RST checks,
instead of utilizing net.inet.tcp.insecure_rst sysctl.

In 2010 a new technique for mitigation of these attacks was
proposed in RFC5961 [2]. The idea is to send a "challenge ACK"
packet to the peer, to verify that packet arrived isn't spoofed.
If peer receives challenge ACK it should regenerate its RST or
SYN with correct sequence number. This should not only protect
against attacks, but also improve communication with broken
stacks, so authors of reverted r167310 and r192912 won't be
disappointed.

[1] http://bandwidthco.com/whitepapers/netforensics/tcpip/TCP Reset Attacks.pdf
[2] http://www.rfc-editor.org/rfc/rfc5961.txt

Changes made:

o Revert r167310.
o Implement "challenge ACK" protection as specificed in RFC5961
  against RST attack. On by default.
  - Carefully preserve r138098, which handles empty window edge
    case, not described by the RFC.
  - Update net.inet.tcp.insecure_rst description.
o Implement "challenge ACK" protection as specificed in RFC5961
  against SYN attack. On by default.
  - Provide net.inet.tcp.insecure_syn sysctl, to turn off
    RFC5961 protection.

The changes were tested at Netflix. The tested box didn't show
any anomalies compared to control box, except slightly increased
number of TCP connection in LAST_ACK state.

Reviewed by: rrs
Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoMake a type conversion explicit. When compiling this code on
tuexen [Tue, 16 Sep 2014 10:57:55 +0000 (10:57 +0000)]
Make a type conversion explicit. When compiling this code on
Windows as part of the SCTP userland stack, this fixes a
warning reported by Peter Kasting from Google.

MFC after: 3 days

9 years agoFix Denial of Service in TCP packet processing.
delphij [Tue, 16 Sep 2014 09:48:24 +0000 (09:48 +0000)]
Fix Denial of Service in TCP packet processing.

Submitted by: glebius
Security: FreeBSD-SA-14:19.tcp

9 years agoThe MTU is handled as a 32-bit entity within the SCTP stack.
tuexen [Tue, 16 Sep 2014 09:22:43 +0000 (09:22 +0000)]
The MTU is handled as a 32-bit entity within the SCTP stack.
This was reported by Peter Kasting from Google.

MFC after: 3 days

9 years agoCache GELI passphrases entered at the console during the boot process,
cperciva [Tue, 16 Sep 2014 08:40:52 +0000 (08:40 +0000)]
Cache GELI passphrases entered at the console during the boot process,
in order to improve user-friendliness when a system has multiple disks
encrypted using the same passphrase.

When examining a new GELI provider, the most recently used passphrase
will be attempted before prompting for a passphrase; and whenever a
passphrase is entered, it is cached for later reference.  When the root
disk is mounted, the cached passphrase is zeroed (triggered by the
"mountroot" event), in order to minimize the possibility of leakage
of passphrases.  (After root is mounted, the "taste and prompt for
passphrases on the console" code path is disabled, so there is no
potential for a passphrase to be stored after the zeroing takes place.)

This behaviour can be disabled by setting kern.geom.eli.boot_passcache=0.

Reviewed by: pjd, dteske, allanjude
MFC after: 7 days

9 years agoFix a typo; master server for iprop service should be singular.
hrs [Tue, 16 Sep 2014 05:45:38 +0000 (05:45 +0000)]
Fix a typo; master server for iprop service should be singular.

9 years agoEnsure the correct software IPv4 hash is done based on the configured
adrian [Tue, 16 Sep 2014 03:26:42 +0000 (03:26 +0000)]
Ensure the correct software IPv4 hash is done based on the configured
RSS parameters, rather than assuming we're hashing IPv4+UDP and IPv4+TCP.

9 years agoModify cpuset_setithread() to take a CPU ID as an integer, not a char.
adrian [Tue, 16 Sep 2014 01:21:47 +0000 (01:21 +0000)]
Modify cpuset_setithread() to take a CPU ID as an integer, not a char.

We're going to end up having > 254 CPUs at some point.

9 years agoBump __FreeBSD_version for the change made in r271655
ngie [Tue, 16 Sep 2014 00:59:56 +0000 (00:59 +0000)]
Bump __FreeBSD_version for the change made in r271655

PR: 181155
Sponsored by: EMC / Isilon Storage Division

9 years agoBump .Dd for the content change done to access(2) in r271655
ngie [Tue, 16 Sep 2014 00:59:08 +0000 (00:59 +0000)]
Bump .Dd for the content change done to access(2) in r271655

PR: 181155
Sponsored by: EMC / Isilon Storage Division

9 years agoValidate the mode argument in access, eaccess, and faccessat for optional
ngie [Tue, 16 Sep 2014 00:56:47 +0000 (00:56 +0000)]
Validate the mode argument in access, eaccess, and faccessat for optional
POSIX compliance and to improve compatibility with Linux and NetBSD

The issue was identified with lib/libc/sys/t_access:access_inval from
NetBSD

Update the manpage accordingly

PR: 181155
Reviewed by: jilles (code), jmmv (code), wblock (manpage), wollman (code)
MFC after: 4 weeks
Phabric: D678 (code), D786 (manpage)
Sponsored by: EMC / Isilon Storage Division

9 years ago* Makefile:
kargl [Mon, 15 Sep 2014 23:21:57 +0000 (23:21 +0000)]
* Makefile:
  . Hook e_lgammal[_r].c to the build.
  . Create man page links for lgammal[-r].3.

* Symbol.map:
  . Sort lgammal to its rightful place.
  . Add FBSD_1.4 section for the new lgamal_r symbol.

* ld128/e_lgammal_r.c:
  . 128-bit implementataion of lgammal_r().

* ld80/e_lgammal_r.c:
  . Intel 80-bit format implementation of lgammal_r().

* src/e_lgamma.c:
  . Expose lgammal as a weak reference to lgamma for platforms
    where long double is mapped to double.

* src/e_lgamma_r.c:
  . Use integer literal constants instead of real literal constants.
    Let compiler(s) do the job of conversion to the appropriate type.
  . Expose lgammal_r as a weak reference to lgamma_r for platforms
    where long double is mapped to double.

* src/e_lgammaf_r.c:
  . Fixed the Cygnus Support conversion of e_lgamma_r.c to float.
    This includes the generation of new polynomial and rational
    approximations with fewer terms.  For each approximation, include
    a comment on an estimate of the accuracy over the relevant domain.
  . Use integer literal constants instead of real literal constants.
    Let compiler(s) do the job of conversion to the appropriate type.
    This allows the removal of several explicit casts of double values
    to float.

* src/e_lgammal.c:
  . Wrapper for lgammal() about lgammal_r().

* src/imprecise.c:
  . Remove the lgamma.

* src/math.h:
  . Add a prototype for lgammal_r().

* man/lgamma.3:
  . Document the new functions.

Reviewed by: bde

9 years agodocument mqueuefs is required for mq_open...
jmg [Mon, 15 Sep 2014 22:32:35 +0000 (22:32 +0000)]
document mqueuefs is required for mq_open...

9 years agoDisable flow-director support until it's been debugged and verified.
adrian [Mon, 15 Sep 2014 21:09:19 +0000 (21:09 +0000)]
Disable flow-director support until it's been debugged and verified.

The flowdirector feature shares on-chip memory with other things
such as the RX buffers.  In theory it should be configured in a way
that doesn't interfere with the rest of operation.  In practice,
the RX buffer calculation didn't take the flow-director allocation
into account and there'd be overlap.  This lead to various garbage
frames being received containing what looks like internal NIC state.

What _I_ saw was traffic ending up in the wrong RX queues.
If I was doing a UDP traffic test with only one NIC ring receiving
traffic, everything is fine.  If I fired up a second UDP stream
which came in on another ring, there'd be a few percent of traffic
from both rings ending up in the wrong ring.  Ie, the RSS hash would
indicate it was supposed to come in ring X, but it'd come in ring Y.

However, when the allocation was fixed up, the developers at Verisign
still saw traffic stalls.

The flowdirector feature ends up fiddling with the NIC to do various
attempts at load balancing connections by populating flow table rules
based on sampled traffic.  It's likely that all of that has to be
carefully reviewed and made less "magic".

So for now the flow director feature is disabled (which fixes both
what I was seeing and what they were seeing) until it's all much
more debugged and verified.

Tested:

* (me) 82599EB 2x10G NIC, RSS UDP testing.
* (verisign) not sure on the NIC (but likely 82599), 100k-200k/sec TCP
  transaction tests.

Submitted by: Marc De La Gueronniere <mdelagueronniere@verisign.com>
MFC after: 1 week
Sponsored by: Verisign, Inc.

9 years agoThe error bits are not valid with EOP=0; so intermediary fragments should
adrian [Mon, 15 Sep 2014 20:54:12 +0000 (20:54 +0000)]
The error bits are not valid with EOP=0; so intermediary fragments should
not be discarded.

Submitted by: Marc De La Gueronniere <mdelagueronniere@verisign.com>
MFC after: 1 week
Sponsored by: Verisign, Inc.

9 years agoFix a double-free of mbufs in rx_ixgbe_discard().
adrian [Mon, 15 Sep 2014 20:50:26 +0000 (20:50 +0000)]
Fix a double-free of mbufs in rx_ixgbe_discard().

fmp->buf at the free point is already part of the chain being freed,
so double-freeing is counter-productive.

Submitted by: Marc De La Gueronniere <mdelagueronniere@verisign.com>
MFC after: 1 week
Sponsored by: Verisign, Inc.

9 years agoSet DROP_EN on each RX queue if transmit flow-control is disabled.
adrian [Mon, 15 Sep 2014 19:53:49 +0000 (19:53 +0000)]
Set DROP_EN on each RX queue if transmit flow-control is disabled.

This allows the NIC to drop frames on the receive queue and not
cause the MAC to block on receiving to _any_ queue.

Tested:

igb0@pci0:5:0:0:        class=0x020000 card=0x152115d9 chip=0x15218086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'I350 Gigabit Network Connection'
    class      = network
    subclass   = ethernet

Discussed with: Eric Joyner <eric.joyner@intel.com>

MFC after: 1 week
Sponsored by: Norse Corp, Inc.

9 years agoAdd quirks to disable READ CAPACITY (16) for PNY USB 3.0 Flash Drives.
mav [Mon, 15 Sep 2014 19:48:27 +0000 (19:48 +0000)]
Add quirks to disable READ CAPACITY (16) for PNY USB 3.0 Flash Drives.

Submitted by: Sean Fagan <sef@ixsystems.com>
MFC after: 3 days

9 years agoChunk IDs are 8 bit entities, not 16 bit.
tuexen [Mon, 15 Sep 2014 19:38:34 +0000 (19:38 +0000)]
Chunk IDs are 8 bit entities, not 16 bit.
Thanks to Peter Kasting from Google for drawing
my attention to it.

MFC after: 3 days

9 years agoAdd stricter checking of some mmap() arguments:
jhb [Mon, 15 Sep 2014 17:20:13 +0000 (17:20 +0000)]
Add stricter checking of some mmap() arguments:
- Fail with EINVAL if an invalid protection mask is passed to mmap().
- Fail with EINVAL if an unknown flag is passed to mmap().
- Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to mmap().
- Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous
  mappings.

Reviewed by: alc, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D698

9 years agoThree improvements to vnode_pager_generic_getpages():
alc [Mon, 15 Sep 2014 17:14:09 +0000 (17:14 +0000)]
Three improvements to vnode_pager_generic_getpages():

Eliminate an exclusive object lock acquisition and release on the expected
execution path.

Do page zeroing before the object lock is acquired rather than during the
time that the object lock is held.

Use vm_pager_free_nonreq() to eliminate duplicated code.

Reviewed by: kib
MFC after: 6 weeks
Sponsored by: EMC / Isilon Storage Division

9 years agoRemove redundant declaration. vnode.h should be included before vnode_pager.h.
glebius [Mon, 15 Sep 2014 15:49:29 +0000 (15:49 +0000)]
Remove redundant declaration. vnode.h should be included before vnode_pager.h.

9 years agoThe private peripheral interrupts start at offset 16, not 0. Also, use
ian [Mon, 15 Sep 2014 15:36:00 +0000 (15:36 +0000)]
The private peripheral interrupts start at offset 16, not 0.  Also, use
names rather than inline mystery constants for these offsets.

Pointed out by: andrew

9 years agoxen: don't set suspend/resume methods for the PIRQ PIC
royger [Mon, 15 Sep 2014 15:15:52 +0000 (15:15 +0000)]
xen: don't set suspend/resume methods for the PIRQ PIC

The suspend/resume of event channels is already handled by the xen_intr_pic.
If those methods are set on the PIRQ PIC they are just called twice, which
breaks proper resume. This fix restores migration of FreeBSD guests to a
working state.

Sponsored by: Citrix Systems R&D

9 years agoUse generic SYSCTL_* macro instead of deprecated SYSCTL_VNET_*.
hrs [Mon, 15 Sep 2014 14:43:58 +0000 (14:43 +0000)]
Use generic SYSCTL_* macro instead of deprecated SYSCTL_VNET_*.

Suggested by: glebius

9 years agoUpgrade to OpenPAM Ourouparia.
des [Mon, 15 Sep 2014 13:40:09 +0000 (13:40 +0000)]
Upgrade to OpenPAM Ourouparia.

9 years agoProvide the unique implementation for the VOP_GETPAGES() method used
kib [Mon, 15 Sep 2014 12:28:29 +0000 (12:28 +0000)]
Provide the unique implementation for the VOP_GETPAGES() method used
by ffs and ext2fs.  Remove duplicated call to vm_page_zero_invalid(),
done by VOP and by vm_pager_getpages().  Use vm_pager_free_nonreq().

Reviewed by: alc (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 6 weeks (after r271596)

9 years agor271256 fixed one segfault condition but introduced another due to the
des [Mon, 15 Sep 2014 11:32:08 +0000 (11:32 +0000)]
r271256 fixed one segfault condition but introduced another due to the
wrong operator being used in the tty check.

Reported by: avg@
MFH: 3 days

9 years agoAdd comments describing r271604 change.
mav [Mon, 15 Sep 2014 11:17:36 +0000 (11:17 +0000)]
Add comments describing r271604 change.

MFC after: 3 days

9 years agoAdd a brief description of CTLFLAG_VNET flag. Since the VIMAGE is
glebius [Mon, 15 Sep 2014 11:14:23 +0000 (11:14 +0000)]
Add a brief description of CTLFLAG_VNET flag. Since the VIMAGE is
absolutely not documented, I see no reason in long descriptions
here.

9 years agoRemove incorrect props
des [Mon, 15 Sep 2014 09:45:10 +0000 (09:45 +0000)]
Remove incorrect props

9 years agoVendor import of OpenPAM Ourouparia.
des [Mon, 15 Sep 2014 09:40:30 +0000 (09:40 +0000)]
Vendor import of OpenPAM Ourouparia.

9 years agoMake net.inet.ip.sourceroute, net.inet.ip.accept_sourceroute, and
hrs [Mon, 15 Sep 2014 07:20:40 +0000 (07:20 +0000)]
Make net.inet.ip.sourceroute, net.inet.ip.accept_sourceroute, and
net.inet.ip.process_options vnet-aware.  Revert changes in r271545.

Suggested by: bz

9 years agoadd gptzfsboot.8, zfsboot.8 and zfsloader.8 manual pages
avg [Mon, 15 Sep 2014 06:21:28 +0000 (06:21 +0000)]
add gptzfsboot.8, zfsboot.8 and zfsloader.8 manual pages

Many thanks to Warren Block for his reviews, corrections and additions.

Reviewed by: Warren Block <wblock@FreeBSD.org>
MFC after: 1 week

9 years agoUse gic_decode_fdt() rather than a local routine to parse fdt interrupt
ian [Sun, 14 Sep 2014 23:48:18 +0000 (23:48 +0000)]
Use gic_decode_fdt() rather than a local routine to parse fdt interrupt
properties.  Move fdt_pic_table and fdt_fixup_table into imx6_machdep.c,
which means imx6 doesn't need imx_common.c anymore.

9 years agoAlways report that we support REPORT TARGET PORT GROUPS command.
mav [Sun, 14 Sep 2014 23:39:13 +0000 (23:39 +0000)]
Always report that we support REPORT TARGET PORT GROUPS command.

Without clustering support we any way have only one group of permanently
active ports, but that gives us one more supported VMWare feature. ;)

Solaris' Comstar also reports it even when only one port is present.

9 years agoAdd couple memory barries to serialize tdq_cpu_idle and tdq_load accesses.
mav [Sun, 14 Sep 2014 22:13:19 +0000 (22:13 +0000)]
Add couple memory barries to serialize tdq_cpu_idle and tdq_load accesses.

This change fixes transient performance drops in some of my benchmarks,
vanishing as soon as I am trying to collect any stats from the scheduler.
It looks like reordered access to those variables sometimes caused loss of
IPI_PREEMPT, that delayed thread execution until some later interrupt.

MFC after: 3 days

9 years agoAdd DEF_CLONE_CMD_ARG2
bryanv [Sun, 14 Sep 2014 22:10:35 +0000 (22:10 +0000)]
Add DEF_CLONE_CMD_ARG2

This will be used in the forthcoming vxlan import.

Reviewed by: gnn
Phabric: https://reviews.freebsd.org/D382

9 years agoFix PowerPC backtraces. Since kernel and user have completely separate address
jhibbits [Sun, 14 Sep 2014 22:03:41 +0000 (22:03 +0000)]
Fix PowerPC backtraces.  Since kernel and user have completely separate address
spaces, rather than a split address, we actually can't check for being within
the kernel's address range.  Instead, do what other backtraces do, and use
trapexit()/asttrapexit() as the stack sentinel.

MFC after: 3 weeks

9 years agoAdd a common routine for parsing FDT data describing an ARM GIC interrupt.
ian [Sun, 14 Sep 2014 21:21:03 +0000 (21:21 +0000)]
Add a common routine for parsing FDT data describing an ARM GIC interrupt.

In the fdt data we've written for ourselves, the interrupt properties
for GIC interrupts have just been a bare interrupt number.  In standard
data that conforms to the published bindings, GIC interrupt properties
contain 3-tuples that describe the interrupt as shared vs private, the
interrupt number within the shared/private address space, and configuration
info such as level vs edge triggered.

The new gic_decode_fdt() function parses both types of data, based on the
#interrupt-cells property.  Previously, each platform implemented a decode
routine and put a pointer to it into fdt_pic_table.  Now they can just
list this function in their table instead if they use arm/gic.c.

9 years agoPull in r217410 from upstream llvm trunk (by Bob Wilson):
dim [Sun, 14 Sep 2014 18:50:38 +0000 (18:50 +0000)]
Pull in r217410 from upstream llvm trunk (by Bob Wilson):

  Set trunc store action to Expand for all X86 targets.

  When compiling without SSE2, isTruncStoreLegal(F64, F32) would return
  Legal, whereas with SSE2 it would return Expand. And since the Target
  doesn't seem to actually handle a truncstore for double -> float, it
  would just output a store of a full double in the space for a float
  hence overwriting other bits on the stack.

  Patch by Luqman Aden!

This should fix clang -O0 on i386 assigning garbage to floats, in
certain scenarios.

PR: 187437
Submitted by: cebd@gmail.com
Obtained from: http://llvm.org/viewvc/llvm-project?rev=217410&view=rev
MFC after: 3 days

9 years agoAvoid an exclusive acquisition of the object lock on the expected execution
alc [Sun, 14 Sep 2014 18:07:55 +0000 (18:07 +0000)]
Avoid an exclusive acquisition of the object lock on the expected execution
path through the NFS clients' getpages functions.

Introduce vm_pager_free_nonreq().  This function can be used to eliminate
code that is duplicated in many getpages functions.  Also, in contrast to
the code that currently appears in those getpages functions,
vm_pager_free_nonreq() avoids acquiring an exclusive object lock in one
case.

Reviewed by: kib
MFC after: 6 weeks
Sponsored by: EMC / Isilon Storage Division

9 years agoAdd compat strings for all the flavors of GIC this driver should support.
ian [Sun, 14 Sep 2014 17:47:04 +0000 (17:47 +0000)]
Add compat strings for all the flavors of GIC this driver should support.
Also allow the driver to attach to ofwbus as well as simplebus, some FDT
data puts the root interrupt controller on the root bus.

9 years agoFix an undefined variable that was accidentally not causing an error.
ian [Sun, 14 Sep 2014 17:36:57 +0000 (17:36 +0000)]
Fix an undefined variable that was accidentally not causing an error.

The code had references to both intr_offset and intr_parent variable names
as referring to the parent interrupt node.  The intr_parent variable
wasn't actually defined anywhere, but the only references to it were as
an argument to a macro that didn't use that argument in expansion, so
the undefined variable accidentally didn't cause an error.

The intr_parent name makes more sense in context, so change all occurrances
of intr_offset to intr_parent.

9 years agosh: Remove arbitrary length limit on << EOF markers.
jilles [Sun, 14 Sep 2014 16:46:30 +0000 (16:46 +0000)]
sh: Remove arbitrary length limit on << EOF markers.

This also simplifies the code.

9 years agosh: Make checkend() a real function instead of an emulated nested function.
jilles [Sun, 14 Sep 2014 16:27:49 +0000 (16:27 +0000)]
sh: Make checkend() a real function instead of an emulated nested function.

No functional change is intended, but the generated code is slightly
different.

9 years agoAdd a comment giving an overview of the driver. Remove leftover debugging.
ian [Sun, 14 Sep 2014 16:12:43 +0000 (16:12 +0000)]
Add a comment giving an overview of the driver.  Remove leftover debugging.

9 years agosh: Add some const keywords.
jilles [Sun, 14 Sep 2014 15:59:15 +0000 (15:59 +0000)]
sh: Add some const keywords.

9 years agoAdded missing ZFS sysctls
smh [Sun, 14 Sep 2014 12:23:00 +0000 (12:23 +0000)]
Added missing ZFS sysctls
* vfs.zfs.vdev.async_write_active_min_dirty_percent
* vfs.zfs.vdev.async_write_active_max_dirty_percent

Added validation of min / max for ZFS sysctl
* vfs.zfs.dirty_data_max_percent

MFC after: 3 days

9 years agoUpdate CAM CCB accounting for the new status quo.
mav [Sun, 14 Sep 2014 11:59:49 +0000 (11:59 +0000)]
Update CAM CCB accounting for the new status quo.

devq_openings counter lost its meaning after allocation queues has gone.
held counter is still meaningful, but problematic to update due to separate
locking of CCB allocation and queuing.

To fix that replace devq_openings counter with allocated counter.  held is
now calculated on request as difference between number of allocated, queued
and active CCBs.

MFC after: 1 month

9 years agoFix mis-spelling of bits and types names in the vnode_pager_putpages().
kib [Sun, 14 Sep 2014 10:27:36 +0000 (10:27 +0000)]
Fix mis-spelling of bits and types names in the vnode_pager_putpages().
The changes should not modify the generated code.

The pager->pgo_putpages() method takes int flags as its fourth
argument, while vnode_pager_putpages() used boolean_t (which is
typedef'ed to int).  The flags are from VM_PAGER_* namespace, while
vnode_pager_putpages() passed TRUE and OBJPC_SYNC to VOP_PUTPAGES(),
which both are numerically equal to VM_PAGER_PUT_SYNC.

Noted and reviewed by: alc (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoUse non-recursive algorithm for traversing nvlists. This also removes
pjd [Sun, 14 Sep 2014 09:30:09 +0000 (09:30 +0000)]
Use non-recursive algorithm for traversing nvlists. This also removes
the limit on number of nested nvlists.

Submitted by: Mariusz Zaborski

9 years agoRemove the limit on descriptors that can be send in one nvlist.
pjd [Sun, 14 Sep 2014 09:27:12 +0000 (09:27 +0000)]
Remove the limit on descriptors that can be send in one nvlist.

Submitted by: Mariusz Zaborski

9 years agoFix descriptors leak.
pjd [Sun, 14 Sep 2014 09:26:33 +0000 (09:26 +0000)]
Fix descriptors leak.

PR: bin/191002
Reported by: Ryan Steinmetz
Submitted by: mjg

9 years agoFix two small nits in ctl.conf(5).
trasz [Sun, 14 Sep 2014 08:35:44 +0000 (08:35 +0000)]
Fix two small nits in ctl.conf(5).

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

9 years agoZFS support isn't actually experimental anymore, so no need to scare
nwhitehorn [Sun, 14 Sep 2014 02:31:53 +0000 (02:31 +0000)]
ZFS support isn't actually experimental anymore, so no need to scare
people.

9 years agoMake the root-on-zfs part of the installer warn a user who booted the installer via...
allanjude [Sun, 14 Sep 2014 01:57:22 +0000 (01:57 +0000)]
Make the root-on-zfs part of the installer warn a user who booted the installer via UEFI that we do not support booting ZFS via UEFI yet

PR: 193595
Approved by: nwhitehorn
MFC after: 5 days
Sponsored by: ScaleEngine Inc.
CR: https://reviews.freebsd.org/D782

9 years agoFix RTC clock writes on many Octeon boards.
kan [Sun, 14 Sep 2014 00:02:40 +0000 (00:02 +0000)]
Fix RTC clock writes on many Octeon boards.

The struct clocktime uses 0-based week day number, so back out part of
r229161 by gonzo, which actually broke the RTC clock writes on Sundays.

9 years agoAdd delay to Octeon MDIO access routines.
kan [Sun, 14 Sep 2014 00:02:37 +0000 (00:02 +0000)]
Add delay to Octeon MDIO access routines.

Prevent saturattion of the bus by constant polling which in
extreme cases can cause interface lockup. This makes FreeBSD
match similar case in the executive.

9 years agoResolve an ambiguity with the definition of a new auth-group
allanjude [Sat, 13 Sep 2014 23:50:51 +0000 (23:50 +0000)]
Resolve an ambiguity with the definition of a new auth-group
Resolve a markup mistake

Reviewed by: trasz
Approved by: bcr (mentor), wblock (mentor)
Sponsored by: ScaleEngine Inc.
CR: https://reviews.freebsd.org/D735

9 years agoRename the choices in the partitioning methods dialog to reflect current
nwhitehorn [Sat, 13 Sep 2014 22:14:19 +0000 (22:14 +0000)]
Rename the choices in the partitioning methods dialog to reflect current
reality. In particular, draw a connection between the auto ZFS script and
the auto UFS one, since they fulfill similar functions. I'm not sure the
auto ZFS code is actually experimental anymore, so it might be worth
changing that label still.

9 years agoMake the default choice for the chroot shell at the end be "No". This allows
nwhitehorn [Sat, 13 Sep 2014 22:03:51 +0000 (22:03 +0000)]
Make the default choice for the chroot shell at the end be "No". This allows
just pressing enter repeatedly to successfully install a reasonable system.

9 years agoRevert r271504. A new patch to solve this issue will be made.
hselasky [Sat, 13 Sep 2014 20:52:01 +0000 (20:52 +0000)]
Revert r271504. A new patch to solve this issue will be made.

Suggested by: adrian @

9 years agoReplace the imx5 and imx6 iomux drivers with a single common driver that
ian [Sat, 13 Sep 2014 20:09:34 +0000 (20:09 +0000)]
Replace the imx5 and imx6 iomux drivers with a single common driver that
uses the new fdt_pinctrl interface.

9 years agoCreate /tmp/bsdinstall_etc even if we aren't starting the installer so that
nwhitehorn [Sat, 13 Sep 2014 20:09:02 +0000 (20:09 +0000)]
Create /tmp/bsdinstall_etc even if we aren't starting the installer so that
dhclient can write resolv.conf when used from the live environment.

PR: 176078
MFC after: 3 days

9 years agoConvert the at91_pinctrl driver to use the new fdt_pinctrl interface.
ian [Sat, 13 Sep 2014 19:59:16 +0000 (19:59 +0000)]
Convert the at91_pinctrl driver to use the new fdt_pinctrl interface.

9 years agoCreate an interface and support routines for drivers that handle IO pin
ian [Sat, 13 Sep 2014 19:03:32 +0000 (19:03 +0000)]
Create an interface and support routines for drivers that handle IO pin
multiplexing and configuration based on FDT data.

Reviewed by: imp

9 years agoDo not set net.inet.ip.{sourceroute,accept_sourceroute} in a vnet jail.
hrs [Sat, 13 Sep 2014 18:54:15 +0000 (18:54 +0000)]
Do not set net.inet.ip.{sourceroute,accept_sourceroute} in a vnet jail.
The following warnings were displayed:

 sysctl: net.inet.ip.sourceroute=0: Operation not permitted
 sysctl: net.inet.ip.accept_sourceroute=0: Operation not permitted

9 years agoSwitch if_vlan(4) to rmlock.
melifaro [Sat, 13 Sep 2014 18:41:24 +0000 (18:41 +0000)]
Switch if_vlan(4) to rmlock.

MFC after: 2 weeks

9 years agoAdd the new iscsi(4) man page
allanjude [Sat, 13 Sep 2014 18:40:12 +0000 (18:40 +0000)]
Add the new iscsi(4) man page
Cross reference it from iscsid(8) and iscsictl(8)

Reviewed by: trasz
Approved by: bcr (mentor), wblock (mentor)
Sponsored by: ScaleEngine Inc.
CR: https://reviews.freebsd.org/D741

9 years agoWe don't need an exclusive object lock on the expected execution path
alc [Sat, 13 Sep 2014 18:26:13 +0000 (18:26 +0000)]
We don't need an exclusive object lock on the expected execution path
through {ext2,ffs}_getpages().

Reviewed by: kib, pfg
MFC after: 6 weeks
Sponsored by: EMC / Isilon Storage Division

9 years agoAdd ZFS support to the bsdinstall partition editor and sade.
nwhitehorn [Sat, 13 Sep 2014 18:24:54 +0000 (18:24 +0000)]
Add ZFS support to the bsdinstall partition editor and sade.

Submitted by: Kurt Lidl (original version)
MFC after: 6 weeks

9 years agoSwitch if_vlan(4) to use counter(9) using new
melifaro [Sat, 13 Sep 2014 18:13:08 +0000 (18:13 +0000)]
Switch if_vlan(4) to use counter(9) using new
  if_get_counter api.

9 years agoMFV r271518:
delphij [Sat, 13 Sep 2014 17:48:44 +0000 (17:48 +0000)]
MFV r271518:

Correctly report hole at end of file.

When asked to find a hole, the DMU sees that there are no holes in the
object, and returns ESRCH.  The ZPL interprets this as "no holes before
the end of the file", and therefore inserts the "virtual hole" at the
end of the file.  Because DMU and ZPL have different ideas of where the
end of an object/file is, we will end up returning the end of file,
which is generally larger, instead of returning the end of object.

The fix is to handle the "virtual hole" in the DMU. If no hole is found,
the DMU will return a hole at the end of the file, rather than an error.

Illumos issue:
    5139 SEEK_HOLE failed to report a hole at end of file

MFC after: 1 week

9 years agoMake inclusion of fdt clock support conditional on fdt_clock, not just fdt.
ian [Sat, 13 Sep 2014 17:38:26 +0000 (17:38 +0000)]
Make inclusion of fdt clock support conditional on fdt_clock, not just fdt.
There are plenty of platforms that use fdt without needing the overhead of
the new clock support routines.

9 years agoMFV r271517:
delphij [Sat, 13 Sep 2014 17:36:34 +0000 (17:36 +0000)]
MFV r271517:

In zil_claim, don't issue warning if we get EBUSY (inconsistent) when
opening an objset, instead, ignore it silently.

Illumos issue:

    5140 message about "%recv could not be opened" is printed when booting after crash

MFC after: 1 week

9 years agoMFV r271516:
delphij [Sat, 13 Sep 2014 17:30:46 +0000 (17:30 +0000)]
MFV r271516:

Enable debug printf's when ZFS_DEBUG or debug= is set.

Illumos issue:

    5134 if ZFS_DEBUG or debug= is set, libzpool should enable debug prints

MFC after: 2 weeks

9 years agoMFV r271515:
delphij [Sat, 13 Sep 2014 17:24:56 +0000 (17:24 +0000)]
MFV r271515:

Add a new tunable/sysctl, vfs.zfs.free_max_blocks, which can be used to
limit how many blocks can be free'ed before a new transaction group is
created.  The default is no limit (infinite), but we should probably have
a lower default, e.g. 100,000.

With this limit, we can guard against the case where ZFS could run out of
memory when destroying large numbers of blocks in a single transaction
group, as the entire DDT needs to be brought into memory.

Illumos issue:
    5138 add tunable for maximum number of blocks freed in one txg

MFC after: 2 weeks

9 years agoMFV r271512:
delphij [Sat, 13 Sep 2014 16:51:23 +0000 (16:51 +0000)]
MFV r271512:

Illumos issue:
    5136 fix write throttle comment in dsl_pool.c

MFC after: 2 weeks

9 years agoMFV r271511:
delphij [Sat, 13 Sep 2014 16:41:39 +0000 (16:41 +0000)]
MFV r271511:

Use fnvlist_* to make code more readable.

Illumos issue:
    5135 zpool_find_import_cached() can use fnvlist_*

MFC after: 2 weeks

9 years agoMFV r271510:
delphij [Sat, 13 Sep 2014 16:26:14 +0000 (16:26 +0000)]
MFV r271510:

Enforce 4K as smallest indirect block size (previously the smallest
indirect block size was 1K but that was never used).

This makes some space estimates more accurate and uses less memory
for some data structures.

Illumos issue:
    5141 zfs minimum indirect block size is 4K

MFC after: 2 weeks

9 years agoDo not try to read i2c info when no transceiver is present.
melifaro [Sat, 13 Sep 2014 16:04:55 +0000 (16:04 +0000)]
Do not try to read i2c info when no transceiver is present.

MFC with: r270064
Sponsored by: Yandex LLC

9 years agoFix error handling in cpuset_setithread() introduced in r267716.
melifaro [Sat, 13 Sep 2014 13:46:16 +0000 (13:46 +0000)]
Fix error handling in cpuset_setithread() introduced in r267716.

Noted by: kib
MFC after: 1 week

9 years agoImplement control over command reordering via options and control mode page.
mav [Sat, 13 Sep 2014 10:34:23 +0000 (10:34 +0000)]
Implement control over command reordering via options and control mode page.

It allows to bypass range checks between UNMAP and READ/WRITE commands,
which may introduce additional delays while waiting for UNMAP parameters.
READ and WRITE commands are always processed in safe order since their
range checks are almost free.

9 years agovt(4): Enclose vt_mouse_paste() prototype inside #ifndef SC_NO_CUTPASTE/#endif
dumbbell [Sat, 13 Sep 2014 09:33:37 +0000 (09:33 +0000)]
vt(4): Enclose vt_mouse_paste() prototype inside #ifndef SC_NO_CUTPASTE/#endif

This fixes the build with sparc64 LINT for instance.

Reported by: bz@
MFC after: 3 days

9 years agoAdd "readcache" and "writecache" LUN options to control default behavior.
mav [Sat, 13 Sep 2014 08:55:22 +0000 (08:55 +0000)]
Add "readcache" and "writecache" LUN options to control default behavior.

Default values are "on".  Disabling requires backend to support IO_DIRECT
and IO_SYNC flags respectively, or some alternatives.

9 years agoImprove transmit sending offload, TSO, algorithm in general.
hselasky [Sat, 13 Sep 2014 08:26:09 +0000 (08:26 +0000)]
Improve transmit sending offload, TSO, algorithm in general.

The current TSO limitation feature only takes the total number of
bytes in an mbuf chain into account and does not limit by the number
of mbufs in a chain. Some kinds of hardware is limited by two
factors. One is the fragment length and the second is the fragment
count. Both of these limits need to be taken into account when doing
TSO. Else some kinds of hardware might have to drop completely valid
mbuf chains because they cannot loaded into the given hardware's DMA
engine. The new way of doing TSO limitation has been made backwards
compatible as input from other FreeBSD developers and will use
defaults for values not set.

MFC after: 1 week
Sponsored by: Mellanox Technologies

9 years agoImplement range checks between UNMAP and READ/WRITE commands.
mav [Sat, 13 Sep 2014 07:45:03 +0000 (07:45 +0000)]
Implement range checks between UNMAP and READ/WRITE commands.

Before this change UNMAP completely blocked other I/Os while running.
Now it blocks only colliding ones, slowing down others only due to ZFS
locks collisions.

Sponsored by: iXsystems, Inc.

9 years agoPropagate the error status of /usr/sbin/bhyve out of the vmrun.sh script.
rodrigc [Sat, 13 Sep 2014 05:08:35 +0000 (05:08 +0000)]
Propagate the error status of /usr/sbin/bhyve out of the vmrun.sh script.
Clean up the /dev/vmm entry for this VM when vmrun.sh exits.

Reviewed by: neel
Phabric:     D767

9 years agoAdd a sysctl to export the EFI memory map along with a handler in the
jhb [Sat, 13 Sep 2014 03:10:02 +0000 (03:10 +0000)]
Add a sysctl to export the EFI memory map along with a handler in the
sysctl(8) binary to format it.

Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D771

9 years agoRegen.
delphij [Sat, 13 Sep 2014 02:18:54 +0000 (02:18 +0000)]
Regen.

9 years agoImport HyperV Key-Value Pair (KVP) driver and daemon code by Microsoft,
delphij [Sat, 13 Sep 2014 02:15:31 +0000 (02:15 +0000)]
Import HyperV Key-Value Pair (KVP) driver and daemon code by Microsoft,
many thanks for their continued support of FreeBSD.

While I'm there, also implement a new build knob, WITHOUT_HYPERV to
disable building and installing of the HyperV utilities when necessary.

The HyperV utilities are only built for i386 and amd64 targets.

This is a stable/10 candidate for inclusion with 10.1-RELEASE.

Submitted by: Wei Hu <weh microsoft com>
MFC after: 1 week

9 years agoWorkaround for receiving Voice Calls using the E1750 dongle from
hselasky [Fri, 12 Sep 2014 22:40:12 +0000 (22:40 +0000)]
Workaround for receiving Voice Calls using the E1750 dongle from
Huawei. It might appear as if the firmware is allocating memory blocks
according to the USB transfer size and if there is initially a lot of
data, like at the answering machine prompt, it simply dies without any
apparent reason. The simple workaround for this is to force a zero
length packet at hardware level after every 512 bytes of data. This
will force the other side to use smaller memory blocks aswell.

MFC after: 1 week

9 years agoSimplify dvd package population with pkg-1.3.
gjb [Fri, 12 Sep 2014 22:20:07 +0000 (22:20 +0000)]
Simplify dvd package population with pkg-1.3.

Submitted by: bdrewery
MFC after: 3 days
X-MFC-With: r271480, r271483
Sponsored by: The FreeBSD Foundation

9 years agocxgbe(4): add support for the SIOCGI2C ioctl.
np [Fri, 12 Sep 2014 21:56:57 +0000 (21:56 +0000)]
cxgbe(4): add support for the SIOCGI2C ioctl.

9 years agoFix various issues with invalid file operations:
jhb [Fri, 12 Sep 2014 21:29:10 +0000 (21:29 +0000)]
Fix various issues with invalid file operations:
- Add invfo_rdwr() (for read and write), invfo_ioctl(), invfo_poll(),
  and invfo_kqfilter() for use by file types that do not support the
  respective operations.  Home-grown versions of invfo_poll() were
  universally broken (they returned an errno value, invfo_poll()
  uses poll_no_poll() to return an appropriate event mask).  Home-grown
  ioctl routines also tended to return an incorrect errno (invfo_ioctl
  returns ENOTTY).
- Use the invfo_*() functions instead of local versions for
  unsupported file operations.
- Reorder fileops members to match the order in the structure definition
  to make it easier to spot missing members.
- Add several missing methods to linuxfileops used by the OFED shim
  layer: fo_write(), fo_truncate(), fo_kqfilter(), and fo_stat().  Most
  of these used invfo_*(), but a dummy fo_stat() implementation was
  added.

9 years agoTweak pipe_truncate() to more closely match pipe_chown() and pipe_chmod()
jhb [Fri, 12 Sep 2014 21:20:36 +0000 (21:20 +0000)]
Tweak pipe_truncate() to more closely match pipe_chown() and pipe_chmod()
by checking PIPE_NAMED and using invfo_truncate() for unnamed pipes.

9 years agoPass the length of an structure to the pretty-printer backends as a
jhb [Fri, 12 Sep 2014 21:01:39 +0000 (21:01 +0000)]
Pass the length of an structure to the pretty-printer backends as a
size_t instead of an int.