]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoAdd an ioctl to assert and deassert an ioapic pin atomically. This will be used
neel [Sat, 23 Nov 2013 03:56:03 +0000 (03:56 +0000)]
Add an ioctl to assert and deassert an ioapic pin atomically. This will be used
to inject edge triggered legacy interrupts into the guest.

Start using the new API in device models that use edge triggered interrupts:
viz. the 8254 timer and the LPC/uart device emulation.

Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)

10 years agofix broken style(9) in r258399
jmg [Sat, 23 Nov 2013 00:28:18 +0000 (00:28 +0000)]
fix broken style(9) in r258399

Pointed out by: brd

10 years agosh: Add tests for the </dev/null implicit in a background command.
jilles [Fri, 22 Nov 2013 21:50:13 +0000 (21:50 +0000)]
sh: Add tests for the </dev/null implicit in a background command.

10 years agoRemove __FreeBSD__ ifdefs.
glebius [Fri, 22 Nov 2013 20:13:32 +0000 (20:13 +0000)]
Remove __FreeBSD__ ifdefs.

10 years agoRewrite usage() so that its source code resembles what is printed.
glebius [Fri, 22 Nov 2013 20:11:17 +0000 (20:11 +0000)]
Rewrite usage() so that its source code resembles what is printed.

10 years agoThe DIOCKILLSRCNODES operation was implemented with O(m*n) complexity,
glebius [Fri, 22 Nov 2013 19:22:26 +0000 (19:22 +0000)]
The DIOCKILLSRCNODES operation was implemented with O(m*n) complexity,
where "m" is number of source nodes and "n" is number of states. Thus,
on heavy loaded router its processing consumed a lot of CPU time.

Reimplement it with O(m+n) complexity. We first scan through source
nodes and disconnect matching ones, putting them on the freelist and
marking with a cookie value in their expire field. Then we scan through
the states, detecting references to source nodes with a cookie, and
disconnect them as well. Then the freelist is passed to pf_free_src_nodes().

In collaboration with: Kajetan Staszkiewicz <kajetan.staszkiewicz innogames.de>
PR: kern/176763
Sponsored by: InnoGames GmbH
Sponsored by: Nginx, Inc.

10 years agoTo support upcoming changes change internal API for source node handling:
glebius [Fri, 22 Nov 2013 19:16:34 +0000 (19:16 +0000)]
To support upcoming changes change internal API for source node handling:
- Removed pf_remove_src_node().
- Introduce pf_unlink_src_node() and pf_unlink_src_node_locked().
  These function do not proceed with freeing of a node, just disconnect
  it from storage.
- New function pf_free_src_nodes() works on a list of previously
  disconnected nodes and frees them.
- Utilize new API in pf_purge_expired_src_nodes().

In collaboration with: Kajetan Staszkiewicz <kajetan.staszkiewicz innogames.de>

Sponsored by: InnoGames GmbH
Sponsored by: Nginx, Inc.

10 years agoAdd missing 'extern'.
glebius [Fri, 22 Nov 2013 19:02:22 +0000 (19:02 +0000)]
Add missing 'extern'.

10 years agoFix off by ones when scanning source nodes hash.
glebius [Fri, 22 Nov 2013 18:57:27 +0000 (18:57 +0000)]
Fix off by ones when scanning source nodes hash.

Sponsored by: Nginx, Inc.

10 years agoEliminate redundant information about the host cpu in bhyve's KTR trace points.
neel [Fri, 22 Nov 2013 18:57:22 +0000 (18:57 +0000)]
Eliminate redundant information about the host cpu in bhyve's KTR trace points.
This is always tracked by ktr(4) and can be displayed using the "-c" option
of ktrdump(8).

Discussed with: grehan

10 years agoStyle: don't compare unsigned <= 0.
glebius [Fri, 22 Nov 2013 18:54:06 +0000 (18:54 +0000)]
Style: don't compare unsigned <= 0.

Sponsored by: Nginx, Inc.

10 years agoTeach acpidump(8) to display the 'Flags' field in the HPET Description Table.
neel [Fri, 22 Nov 2013 18:53:54 +0000 (18:53 +0000)]
Teach acpidump(8) to display the 'Flags' field in the HPET Description Table.

Reviewed by: jhb@

10 years agoRefactor i386 startup SMAP parsing
emaste [Fri, 22 Nov 2013 18:31:07 +0000 (18:31 +0000)]
Refactor i386 startup SMAP parsing

This is a port from amd64 of r258436, and is intended to make diffs
(against amd64 and for future UEFI work) easier to review.

Reviewed by: jhb@
Sponsored by: The FreeBSD Foundation

10 years agoRevert r258455 for now, as it apparently causes miscompilation in some
dim [Fri, 22 Nov 2013 17:54:53 +0000 (17:54 +0000)]
Revert r258455 for now, as it apparently causes miscompilation in some
situations.  Until this is fully resolved, the X.org workaround in ports
still needs to take place.

10 years agoDon't abort SMAP processing after an entry of length 0
emaste [Fri, 22 Nov 2013 14:56:10 +0000 (14:56 +0000)]
Don't abort SMAP processing after an entry of length 0

Length 0 is not special and should just be skipped.  This is the same
behaviour as i386.

Discussed with: jhb@
Sponsored by: The FreeBSD Foundation

10 years ago- Purge one more reference to ad(4)[1].
pluknet [Fri, 22 Nov 2013 12:09:15 +0000 (12:09 +0000)]
- Purge one more reference to ad(4)[1].
- NSWAPDEV limit has gone.

Noticed by: Sergey V. Dyatko [1]
MFC after: 1 week

10 years agoadd a counter on the struct mq (a queue of mbufs),
luigi [Fri, 22 Nov 2013 05:02:37 +0000 (05:02 +0000)]
add a counter on the struct mq (a queue of mbufs),
and add a block for userspace compiling.

10 years agodisable some ipfw match options when compiling in userspace
luigi [Fri, 22 Nov 2013 05:01:38 +0000 (05:01 +0000)]
disable some ipfw match options when compiling in userspace

10 years agomake this code compile in userspace on OSX
luigi [Fri, 22 Nov 2013 05:00:18 +0000 (05:00 +0000)]
make this code compile in userspace on OSX

10 years agomore support for userspace compiling of this code:
luigi [Fri, 22 Nov 2013 04:59:17 +0000 (04:59 +0000)]
more support for userspace compiling of this code:
emulate the uma_zone for dynamic rules.

10 years agomake ipfw_check_packet() and ipfw_check_frame() public,
luigi [Fri, 22 Nov 2013 04:57:50 +0000 (04:57 +0000)]
make ipfw_check_packet() and ipfw_check_frame() public,
so they can be used in the userspace version of ipfw/dummynet
(normally using netmap for the I/O path).

This is the first of a few commits to ease compiling the
ipfw kernel code in userspace.

10 years agoImprove network device scanning in the netdev module. First, make it use the
dteske [Fri, 22 Nov 2013 00:32:32 +0000 (00:32 +0000)]
Improve network device scanning in the netdev module. First, make it use the
`device.subr' framework (improving performane and reducing sub-shells). Next
improve the `device.subr' framework itself. Make use of the `flags' device
struct member for network interfaces to indicate if an interface is Active,
Wired Ethernet, or 802.11 Wireless. Functions have been added to make checks
against the `flags' bit-field quick and efficient. Last, add function for
rescanning the network to update the device registers. Remove an unnecessary
local (ifn) while we're here (use already provided local `if').

10 years agoFix mergemaster -U by forcing FreeBSD 9 compatiblity in mtree when mtree is
brooks [Fri, 22 Nov 2013 00:06:11 +0000 (00:06 +0000)]
Fix mergemaster -U by forcing FreeBSD 9 compatiblity in mtree when mtree is
nmtree.

The mtree output used by mergemaster in this case was clearly not meant for
computer consumption and an approach based on -f <file1> -f <file2> would
probalby be a better idea, but this is a minimal change.

MFC after: 3 days
X-MFC-with: r258437

10 years agoPull in r195318 from upstream llvm trunk:
dim [Thu, 21 Nov 2013 23:09:07 +0000 (23:09 +0000)]
Pull in r195318 from upstream llvm trunk:

  The basic problem is that some mainstream programs cannot deal with the way
  clang optimizes tail calls, as in this example:

  int foo(void);
  int bar(void) {
  return foo();
  }

  where the call is transformed to:

   calll .L0$pb
  .L0$pb:
   popl  %eax
  .Ltmp0:
   addl  $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax
   movl  foo@GOT(%eax), %eax
   popl  %ebp
   jmpl  *%eax                   # TAILCALL

  However, the GOT references must all be resolved at dlopen() time, and so this
  approach cannot be used with lazy dynamic linking (e.g. using RTLD_LAZY), which
  usually populates the PLT with stubs that perform the actual resolving.

  This patch changes X86TargetLowering::LowerCall() to skip tail call
  optimization, if the called function is a global or external symbol.

This fixes problems with loading X.org driver modules, which could occur
when X.org was compiled on i386 with tailcall optimization on, for which
ports r312583 was committed as a workaround.  After this change, the
workaround can be removed.

MFC after: 3 days

10 years agoReplace the WEAK_ALIAS() alias with the WEAK_REFERENCE() alias. Use it and
andreast [Thu, 21 Nov 2013 22:31:18 +0000 (22:31 +0000)]
Replace the WEAK_ALIAS() alias with the WEAK_REFERENCE() alias. Use it and
get rid of the __CONCAT and CNAME macros.

Reviewed by: bde, kib

10 years agoHave the GPT probe return a lower priority when the MBR is not a PMBR
marcel [Thu, 21 Nov 2013 22:02:59 +0000 (22:02 +0000)]
Have the GPT probe return a lower priority when the MBR is not a PMBR
The purpose of the PMBR is to have the disk appear in use to GPT
unaware utilities (like fdisk).  However, if the PMBR has been changed
by a GPT unaware utlity then we must assume that this was deliberate
(as it involved removal of the special slice) and we should not treat
the unmodified GPT-specific sectors as being valid.  By lowering the
probe priority in that case, the MBR scheme will take precedence and
the kernel will end up using the MBR and not the GPT. We will still
use the GPT if the kernel does not support the MBR scheme.

10 years agoIntroduce a WEAK_REFERENCE() alias and use it. Get rid of the CNAME and the
andreast [Thu, 21 Nov 2013 21:25:58 +0000 (21:25 +0000)]
Introduce a WEAK_REFERENCE() alias and use it. Get rid of the CNAME and the
CONCAT macros in SYS.h.

Reviewed by: bde, kib

10 years agoAdd static where appropriate.
eadler [Thu, 21 Nov 2013 21:19:01 +0000 (21:19 +0000)]
Add static where appropriate.
Sync with some of DragonflyBSD's latest cleanups

Reviewed by: mjg

10 years agoFix cross compilation after r258428.
andreast [Thu, 21 Nov 2013 21:05:11 +0000 (21:05 +0000)]
Fix cross compilation after r258428.

Reviewed by: pfg

10 years agoCatch up with OpenPAM Nummularia.
pluknet [Thu, 21 Nov 2013 20:43:43 +0000 (20:43 +0000)]
Catch up with OpenPAM Nummularia.

This fixes libpam for build32 target to dlopen() pam libraries in /usr/lib32.

Reviewed by: des (a while ago)
MFC after: 1 week

10 years agoKill ARM_VFP_SUPPORT, it's been removed some time ago.
cognet [Thu, 21 Nov 2013 20:39:53 +0000 (20:39 +0000)]
Kill ARM_VFP_SUPPORT, it's been removed some time ago.

10 years agocxgbe(4): update the internal list of device features.
np [Thu, 21 Nov 2013 20:07:58 +0000 (20:07 +0000)]
cxgbe(4): update the internal list of device features.

MFC after: 3 days

10 years agomdoc: remove EOL whitespace.
joel [Thu, 21 Nov 2013 19:44:48 +0000 (19:44 +0000)]
mdoc: remove EOL whitespace.

10 years agof_die() (see `bsdconfig includes -dF die') uses a dialog box (and has been
dteske [Thu, 21 Nov 2013 19:43:45 +0000 (19:43 +0000)]
f_die() (see `bsdconfig includes -dF die') uses a dialog box (and has been
documented as such; I just forgot). These utilities are command-line only
and as such should stick to either using f_die without arguments or printf)

10 years agoFix reference to ioctl(2).
pluknet [Thu, 21 Nov 2013 19:31:57 +0000 (19:31 +0000)]
Fix reference to ioctl(2).

10 years agoSync with NetBSD. The funtional change is to make the output when
brooks [Thu, 21 Nov 2013 19:29:41 +0000 (19:29 +0000)]
Sync with NetBSD.  The funtional change is to make the output when
comparing a directory to an mtree file more compatible with fmtree when
FreeBSD 9 compatiblity mode is on.  This output is clearly intended for
humans not computers, but some tools such as mergemaster's -U option rely
on it.

MFC after: 3 days

10 years agoRefactor amd64 startup SMAP parsing
emaste [Thu, 21 Nov 2013 19:20:08 +0000 (19:20 +0000)]
Refactor amd64 startup SMAP parsing

Extracted from the projects/uefi branch, this change is a reasonable
cleanup and will reduce the diffs to review when bringing in the
UEFI work.

Reviewed by: kib@
Sponsored by: The FreeBSD Foundation

10 years agoUpdate text related to Intel CPU support and Apple hardware support.
rodrigc [Thu, 21 Nov 2013 19:04:59 +0000 (19:04 +0000)]
Update text related to Intel CPU support and Apple hardware support.

Submitted by: skreuzer

10 years agoUpdate copyrights
rodrigc [Thu, 21 Nov 2013 19:00:21 +0000 (19:00 +0000)]
Update copyrights

Submitted by: skreuzer

10 years agoDisable amd64 boot time memory test by default
emaste [Thu, 21 Nov 2013 18:37:11 +0000 (18:37 +0000)]
Disable amd64 boot time memory test by default

The page presence memory test takes a long time on large memory systems
and has little value on contemporary amd64 hardware.

Sponsored by: The FreeBSD Foundation

10 years agoRemove unused line -- cruft left over from SVN r258360.
dteske [Thu, 21 Nov 2013 17:49:56 +0000 (17:49 +0000)]
Remove unused line -- cruft left over from SVN r258360.

10 years agolibstdc++: merge non-abi changes from Apple's developer tools
pfg [Thu, 21 Nov 2013 16:44:36 +0000 (16:44 +0000)]
libstdc++: merge non-abi changes from Apple's developer tools

Take some changes from Apple's Developer Tools 4.0 [1]:

block.patch
emergency-buffer-reduction.patch
test_cleanup.patch

vector_copy_no_alloc.patch
problem/6473222 copy-constructing a std::vector from an
empty std::vector calls malloc

2008-10-27  Howard Hinnant
stl_tree_system_header.patch
Added #pragma GCC system_header to stl_tree.h.
copy_doc.patch
Corrected documentation concerning copy in stl_algobase.h.
string_compare.patch
Fixed basic_string.h, basic_string.tcc, incorrect 64bit to
32bit narrowing.

Reference:

[1] http://opensource.apple.com/source/libstdcxx/libstdcxx-39/patches-4.2.1/

Obtained from: Apple
MFC after: 1 month

10 years agogcc: another round of merges from the gcc pre-43 branch.
pfg [Thu, 21 Nov 2013 16:38:57 +0000 (16:38 +0000)]
gcc: another round of merges from the gcc pre-43 branch.

Bring The following revisions from the gcc43 branch[1]:

118360, 118361, 118363, 118576, 119820,
123906, 125246, and 125721.

They all have in common that the were merged long ago
into Apple's gcc and should help improve the general
quality of the compiler and make it easier to bring
new features from Apple's gcc42.

For details please review the additions to the files:
gcc/ChangeLog.gcc43
gcc/cp/ChangeLog.gcc43 (new, adds previous revisions)

Reference:
[1] http://gcc.gnu.org/viewcvs/gcc/trunk/?pathrev=126700

Obtained from: gcc pre4.3 (GPLv2) branch
MFC after: 3 weeks

10 years agoFor PCI<->PCI bridges, #address-cells may be 3. Allow this when parsing the
nwhitehorn [Thu, 21 Nov 2013 15:41:52 +0000 (15:41 +0000)]
For PCI<->PCI bridges, #address-cells may be 3. Allow this when parsing the
ibm,dma-window properties. This is especially a concern when
#ibm,dma-address-cells is not specified and we have to use the regular
#address-cells property.

MFC after: 1 week

10 years agolibexecinfo: Include terminating null in byte count
emaste [Thu, 21 Nov 2013 14:12:36 +0000 (14:12 +0000)]
libexecinfo: Include terminating null in byte count

Otherwise, a formatted string with a strlen equal to the remaining
buffer space would have the last character omitted (because vsnprintf
always null-terminates), and later the assert in backtrace_symbols_fmt
would fail.

MFC after: 3 days
Sponsored by: DARPA, AFRL

10 years agoUnbreak compilation with GCC.
gber [Thu, 21 Nov 2013 09:19:14 +0000 (09:19 +0000)]
Unbreak compilation with GCC.

10 years agoRemove stale comment. The PID provider is handled elsewhere already.
jhibbits [Thu, 21 Nov 2013 06:54:28 +0000 (06:54 +0000)]
Remove stale comment.  The PID provider is handled elsewhere already.

10 years agoQuote the interface name for good measure.
dteske [Thu, 21 Nov 2013 03:22:13 +0000 (03:22 +0000)]
Quote the interface name for good measure.

10 years agoCall cpu_setup() from the initarm() routine on platforms that don't use
ian [Thu, 21 Nov 2013 01:08:10 +0000 (01:08 +0000)]
Call cpu_setup() from the initarm() routine on platforms that don't use
the common FDT-aware initarm() in arm/machdep.c.

Pointed out by:      cognet
Pointy hat to:      ian

10 years agoRevert SVN r257830 -- that feature was annoying and was removed long ago.
dteske [Thu, 21 Nov 2013 00:54:26 +0000 (00:54 +0000)]
Revert SVN r257830 -- that feature was annoying and was removed long ago.
Was a momentary memory lapse induced by old code that was lying in my ~/bin

10 years agoIn pmap_unmapdev(), remember the size, and use that as an argument to
cognet [Wed, 20 Nov 2013 23:06:54 +0000 (23:06 +0000)]
In pmap_unmapdev(), remember the size, and use that as an argument to
kva_free(), or we'd end up always passing it a size of 0, and for some
strange reason it doesn't seem to like it.

10 years agoUpdate function description for API tool:
dteske [Wed, 20 Nov 2013 22:12:21 +0000 (22:12 +0000)]
Update function description for API tool:
bsdconfig includes -dF f_validate_hostname

10 years agoMake `-d' implicitly enable `-f' for simplification.
dteske [Wed, 20 Nov 2013 22:11:42 +0000 (22:11 +0000)]
Make `-d' implicitly enable `-f' for simplification.

10 years agofix white space...
jmg [Wed, 20 Nov 2013 21:21:29 +0000 (21:21 +0000)]
fix white space...

MFC after: 1 week

10 years agofix a use after free, jsegdep_merge will free wk, avoid the next check...
jmg [Wed, 20 Nov 2013 21:16:53 +0000 (21:16 +0000)]
fix a use after free, jsegdep_merge will free wk, avoid the next check...

CID: 1006098
Sponsored by: Imaginary Forces
Reviewed by: mckusick
MFC after: 1 week

10 years agoAdd a `-d' flag for printing the description of each function.
dteske [Wed, 20 Nov 2013 21:05:33 +0000 (21:05 +0000)]
Add a `-d' flag for printing the description of each function.

10 years agoAdd new `includes' module for exploring the bsdconfig(8) API.
dteske [Wed, 20 Nov 2013 20:37:21 +0000 (20:37 +0000)]
Add new `includes' module for exploring the bsdconfig(8) API.

10 years agoflag that the aesni driver is sync... This means we don't waste a
jmg [Wed, 20 Nov 2013 20:25:27 +0000 (20:25 +0000)]
flag that the aesni driver is sync...  This means we don't waste a
context switch just to call the done callback...  On my machine, this
improves geli/gzero decrypt performance by ~27% from 550MB/sec to
~700MB/sec...

MFC after: 3 days

10 years agoRedo r258088 to avoid relying on signed arithmetic overflow, since
kib [Wed, 20 Nov 2013 19:41:00 +0000 (19:41 +0000)]
Redo r258088 to avoid relying on signed arithmetic overflow, since
compiler interprets this as an undefined behaviour.  Instead, ensure
that the sum of uio_offset and uio_resid is below OFF_MAX using the
operation which cannot overflow.

Reported and tested by: pho
Discussed with: bde
Approved by: des (pseudofs maintainer)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoChange introduction history.
peter [Wed, 20 Nov 2013 17:48:38 +0000 (17:48 +0000)]
Change introduction history.

10 years agoAdd USB_HOST_ALIGN=64; the cache line size on the am335x is 64 bytes.
ian [Wed, 20 Nov 2013 16:42:01 +0000 (16:42 +0000)]
Add USB_HOST_ALIGN=64; the cache line size on the am335x is 64 bytes.

10 years agoCall cpu_setup() immediately after the page tables are installed. This
ian [Wed, 20 Nov 2013 15:53:50 +0000 (15:53 +0000)]
Call cpu_setup() immediately after the page tables are installed.  This
enables data cache and other chip-specific features.  It was previously
done via an early SYSINIT, but it was being done after pmap and vm setup,
and those setups need to use mutexes.  On some modern ARM platforms,
the ldrex/strex instructions that implement mutexes require the data cache
to be enabled.

A nice side effect of enabling caching earlier is that it eliminates the
multi-second pause that used to happen early in boot while physical memory
and pmap and vm were being set up.  On boards with 1 GB or more of ram
this pause was very noticible, sometimes 5-6 seconds.

PR: arm/183740

10 years agoFix comment after r250551.
glebius [Wed, 20 Nov 2013 13:22:22 +0000 (13:22 +0000)]
Fix comment after r250551.

10 years agoPrint some more flags.
mav [Wed, 20 Nov 2013 12:32:34 +0000 (12:32 +0000)]
Print some more flags.

10 years agoMFV r258378: 4089 NULL pointer dereference in arc_read()
avg [Wed, 20 Nov 2013 11:52:32 +0000 (11:52 +0000)]
MFV r258378: 4089 NULL pointer dereference in arc_read()

illumos/illumos-gate@57815f6b95a743697e148327725b7f568e75e6ea

Tested by: adrian
MFC after: 4 days

10 years agoMFV r258377: 4088 use after free in arc_release()
avg [Wed, 20 Nov 2013 11:47:50 +0000 (11:47 +0000)]
MFV r258377: 4088 use after free in arc_release()

illumos/illumos-gate@ccc22e130479b5bd7c0002267fee1e0602d3f772

MFC after: 5 days

10 years agoSplit raw reading/programming into smaller chunks to avoid allocating too
gber [Wed, 20 Nov 2013 11:10:23 +0000 (11:10 +0000)]
Split raw reading/programming into smaller chunks to avoid allocating too
big chunk of kernel memory. Validate size of data. Add error handling to
avoid calling copyout() when data has not been read correctly.

Reviewed by:    zbb
Reported by:    x90c <geinblues@gmail.com>
MFC after:      2 days

10 years agoVm map code performs clipping when map entry covers region which is
kib [Wed, 20 Nov 2013 09:03:48 +0000 (09:03 +0000)]
Vm map code performs clipping when map entry covers region which is
larger than the operational region.  If the op region size is zero,
clipping would create a zero-sized map entry.  The result is that vm
map splay starts behaving inconsistently, sometimes returning
zero-sized entry, sometimes the next (or previous) entry.

One step further, it could result in e.g. vm_map_wire() setting
MAP_ENTRY_IN_TRANSITION on the zero-sized entry, but failing to clear
it in the done part.  The vm_map_delete() than hangs forever waiting
for the flag removal.

Verify for zero-length requests and act as if it is always successfull
without performing any action on the address space.

Diagnosed by: pho
Tested by: pho (previous version)
Reviewed by: alc (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoAdd assertions to cover all places in the wiring and unwiring code
kib [Wed, 20 Nov 2013 08:47:54 +0000 (08:47 +0000)]
Add assertions to cover all places in the wiring and unwiring code
where MAP_ENTRY_IN_TRANSITION is set or cleared.

Tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoRevert back to use int for the page counts. In vn_io_fault(), the i/o
kib [Wed, 20 Nov 2013 08:45:26 +0000 (08:45 +0000)]
Revert back to use int for the page counts.  In vn_io_fault(), the i/o
is chunked to pieces limited by integer io_hold_cnt tunable, while
vm_fault_quick_hold_pages() takes integer max_count as the upper bound.

Rearrange the checks to correctly handle overflowing address arithmetic.

Submitted by: bde
Tested by: pho
Discussed with: alc
MFC after: 1 week

10 years agoRegenerate after r258363 (alternate ID for Novatel MiFi 2200) and
truckman [Wed, 20 Nov 2013 02:20:27 +0000 (02:20 +0000)]
Regenerate after r258363 (alternate ID for Novatel MiFi 2200) and
r258333 (bus_autoconf.sh tweak).

10 years agoAdd alternate ID for Novatel MiFi 2200 CDMA, which is used by my
truckman [Wed, 20 Nov 2013 02:16:47 +0000 (02:16 +0000)]
Add alternate ID for Novatel MiFi 2200 CDMA, which is used by my
Virgin Mobile branded device.  It needs the U3GINIT_SCSIEJECT quirk.

Reviewed by: hselasky
MFC after: 1 month

10 years agoUse 'int' to store the return value of getopt(), rather than char.
jhibbits [Wed, 20 Nov 2013 01:42:29 +0000 (01:42 +0000)]
Use 'int' to store the return value of getopt(), rather than char.

On some architectures (powerpc), char is unsigned by default, which means
comparisons against -1 always fail, so the programs get stuck in an
infinite loop.

MFC after: 1 week

10 years agoFix the function search space.
jhibbits [Wed, 20 Nov 2013 01:33:13 +0000 (01:33 +0000)]
Fix the function search space.

Submitted by: Howard Su

10 years agoWhitespace, style, sub-shells, and standardize variable name
dteske [Wed, 20 Nov 2013 00:17:57 +0000 (00:17 +0000)]
Whitespace, style, sub-shells, and standardize variable name
(s/interfaces/menu_list/).

10 years agoApply access flags for managed and unmanaged pages properly on ARMv6/v7
zbb [Tue, 19 Nov 2013 23:37:50 +0000 (23:37 +0000)]
Apply access flags for managed and unmanaged pages properly on ARMv6/v7

When entering a mapping via pmap_enter() unmanaged pages ought to be
naturally excluded from the "modified" and "referenced" emulation.
RW permission should be granted implicitly when requested,
otherwise unmanaged page will not recover from the permission fault
since there will be no PV entry to indicate that the page can be written.

In addition, only managed pages that participate in "modified"
emulation need to be marked as "dirty" and "writeable" when entered
with RW permissions. Likewise with "referenced" flag for managed pages.
Unmanaged ones however should not be marked as such.

Reviewed by: cognet, gber

10 years agoAvoid clearing EXEC permission bit when setting the page RW on ARMv6/v7
zbb [Tue, 19 Nov 2013 23:31:39 +0000 (23:31 +0000)]
Avoid clearing EXEC permission bit when setting the page RW on ARMv6/v7

When emulating modified bit the executable attribute was cleared by
mistake when calling pmap_set_prot(). This was not a problem before
changes to ref/mod emulation since all the pages were created RW basing
on the "prot" argument in pmap_enter(). Now however not all pages are RW
and the RW permission can be cleared in the process.

Added proper KTRs accordingly.

Spotted by: cognet
Reviewed by: gber

10 years agoAdd "resize" verb to gmirror(8) and such functionality to geom_mirror(4).
ae [Tue, 19 Nov 2013 22:55:17 +0000 (22:55 +0000)]
Add "resize" verb to gmirror(8) and such functionality to geom_mirror(4).
Now it is easy to expand the size of the mirror when all its components
are replaced. Also add g_resize method to geom_mirror class. It will write
updated metadata to new last sector, when parent provider is resized.

Silence from: geom@
MFC after: 1 month

10 years agoBugfixes... the host capabilties from FDT data are stored in host.caps, not
ian [Tue, 19 Nov 2013 22:14:35 +0000 (22:14 +0000)]
Bugfixes... the host capabilties from FDT data are stored in host.caps, not
host.host_ocr, examine the correct field when setting up the hardware.  Also,
the offset for the capabilties register should be 0x140, not 0x240.

Submitted by: Ilya Bakulin <ilya@bakulin.de>
Pointy hat to: me

10 years ago"Tim trailing" -> "Trim trailing"
trhodes [Tue, 19 Nov 2013 19:55:41 +0000 (19:55 +0000)]
"Tim trailing" -> "Trim trailing"

10 years agotaskqueue_cancel: garbage collect a write-only variable
avg [Tue, 19 Nov 2013 18:45:29 +0000 (18:45 +0000)]
taskqueue_cancel: garbage collect a write-only variable

MFC after: 3 days

10 years agozfs page_busy: fix the boundaries of the cleared range
avg [Tue, 19 Nov 2013 18:43:47 +0000 (18:43 +0000)]
zfs page_busy: fix the boundaries of the cleared range

This is a fix for a regression introduced in r246293.

vm_page_clear_dirty expects the range to have DEV_BSIZE aligned boundaries,
otherwise it extends them.  Thus it can happen that the whole page is
marked clean while actually having some small dirty region(s).
This commit makes the range properly aligned and ensures that only
the clean data is marked as such.

It would interesting to evaluate how much benefit clearing with DEV_BSIZE
granularity produces.  Perhaps instead we should clear the whole page
when it is completely overwritten and don't bother clearing any bits
if only a portion a page is written.

Reported by: George Hartzell <hartzell@alerce.com>,
Richard Todd <rmtodd@servalan.servalan.com>
Tested by: George Hartzell <hartzell@alerce.com>,
Reviewed by: kib
MFC after: 5 days

10 years agofsx: add an option to randomly call msync(MS_INVALIDATE)
avg [Tue, 19 Nov 2013 18:35:38 +0000 (18:35 +0000)]
fsx: add an option to randomly call msync(MS_INVALIDATE)

This call should be a sufficiently close approximation of what happens
when a filesystem is unmounted and remounted.  To be more specific, it
should test that the data that was in the page cache is the same data
that ends up on a stable storage or in a filesystem's internal cache,
if any.
This will catch the cases where a page with modified data is marked as
a clean page for whatever reason.

While there, make logging of the special events (open+close before
plus invalidation now) more generic and slightly better than the previous
hack.

MFC after: 10 days

10 years agofsx: new option to disable msync(MS_SYNC) after each write via mmaped region
avg [Tue, 19 Nov 2013 18:35:01 +0000 (18:35 +0000)]
fsx: new option to disable msync(MS_SYNC) after each write via mmaped region

This option should be useful for testing if a filesystem uses the
unified buffer / page cache.
Or, if filesystem's emulation of the unified cache works as expected.
This should be the case for e.g. ZFS.

MFC after: 1 week

10 years agoPull in r191896 from upstream llvm trunk:
dim [Tue, 19 Nov 2013 17:53:19 +0000 (17:53 +0000)]
Pull in r191896 from upstream llvm trunk:

  CaptureTracking: Plug a loophole in the "too many uses" heuristic.

  The heuristic was added to avoid spending too much compile time in a
  specially crafted test case (PR17461, PR16474) with many uses on a
  select or bitcast instruction can still trigger the slow case. Add a
  check for that case.

  This only affects compile time, don't have a good way to test it.

This fixes the excessive compile time spent on a specific file of the
graphics/rawtherapee port.

Reported by: mandree
MFC after: 3 days

10 years agoFix build with GCC
bdrewery [Tue, 19 Nov 2013 16:11:03 +0000 (16:11 +0000)]
Fix build with GCC

SSL_set_tlsext_host_name(3) internally does not modify the host buffer
pased to it. So it is safe to DECONST the struct url* here.

Reported by: gjb
Approved by: bapt (implicit)
MFC after: 1 week
X-MFC-With: r258347

10 years agoFollow-up to r258227 and document 'enabled' as a boolean instead of
bdrewery [Tue, 19 Nov 2013 15:43:27 +0000 (15:43 +0000)]
Follow-up to r258227 and document 'enabled' as a boolean instead of
a string.

Approved by: bapt
MFC after: 2 days
X-MFC-With: r258227

10 years agoSupport SNI in libfetch
bdrewery [Tue, 19 Nov 2013 15:35:26 +0000 (15:35 +0000)]
Support SNI in libfetch

SNI is Server Name Indentification which is a protocol for TLS that
indicates the host that is being connected to at the start of the
handshake. It allows to use Virtual Hosts on HTTPS.

Submitted by: sbz
Submitted by: Michael Gmelin <freebsd@grem.de> [1]
PR: kern/183583 [1]
Reviewed by: des
Approved by: bapt
MFC after: 1 week

10 years agoOne more BIND remnant: /etc/mtree/BIND.chroot.dist
tijl [Tue, 19 Nov 2013 13:32:24 +0000 (13:32 +0000)]
One more BIND remnant: /etc/mtree/BIND.chroot.dist

Discussed with: des

10 years agoReenable vfs.zfs.zio.use_uma for amd64, disabled at r209261.
mav [Tue, 19 Nov 2013 11:19:07 +0000 (11:19 +0000)]
Reenable vfs.zfs.zio.use_uma for amd64, disabled at r209261.

On machines with seveal CPUs and enough RAM this can easily twice improve
ZFS performance or twice reduce CPU usage.  It was disabled three years
ago due to memory and KVA exhaustion reports, but our VM subsystem got
improved a lot since that time, hopefully enough to make another try.

10 years agoImplement mechanism to safely but slowly purge UMA per-CPU caches.
mav [Tue, 19 Nov 2013 10:51:46 +0000 (10:51 +0000)]
Implement mechanism to safely but slowly purge UMA per-CPU caches.

This is a last resort for very low memory condition in case other measures
to free memory were ineffective.  Sequentially cycle through all CPUs and
extract per-CPU cache buckets into zone cache from where they can be freed.

10 years agoGrow UMA zone bucket size also on lock congestion during item free.
mav [Tue, 19 Nov 2013 10:17:10 +0000 (10:17 +0000)]
Grow UMA zone bucket size also on lock congestion during item free.

Lock congestion is the same, whether it happens on alloc or free, so
handle it equally.  Now that we have back pressure, there is no problem
to grow buckets a bit faster.  Any way growth is much slower then in 9.x.

10 years agoAdd two new UMA bucket zones to store 3 and 9 items per bucket.
mav [Tue, 19 Nov 2013 10:10:44 +0000 (10:10 +0000)]
Add two new UMA bucket zones to store 3 and 9 items per bucket.

These new buckets make bucket size self-tuning more soft and precise.
Without them there are buckets for 1, 5, 13, 29, ... items.  While at
bigger sizes difference about 2x is fine, at smallest ones it is 5x and
2.6x respectively.  New buckets make that line look like 1, 3, 5, 9, 13,
29, reducing jumps between steps, making algorithm work softer, allocating
and freeing memory in better fitting chunks.  Otherwise there is quite a
big gap between allocating 128K and 5x128K of RAM at once.

10 years agoImplement soft pressure on UMA cache bucket sizes.
mav [Tue, 19 Nov 2013 10:05:53 +0000 (10:05 +0000)]
Implement soft pressure on UMA cache bucket sizes.

Every time system detects low memory condition decrease bucket sizes for
each zone by one item.  As result, higher memory pressure will push to
smaller bucket sizes and so smaller per-CPU caches and so more efficient
memory use.

Before this change there was no force to oppose buckets growth as result
of practically inevitable zone lock conflicts, and after some run time
per-CPU caches could consume enough RAM to kill the system.

10 years agoProvide the correct path to bus_autoconf.sh.
markj [Tue, 19 Nov 2013 00:43:53 +0000 (00:43 +0000)]
Provide the correct path to bus_autoconf.sh.

10 years agoRegenerate usb.conf after r258331.
markj [Tue, 19 Nov 2013 00:40:38 +0000 (00:40 +0000)]
Regenerate usb.conf after r258331.

10 years agoImport the axge(4) driver for the ASIX AX88178A and AX88179 USB Ethernet
markj [Tue, 19 Nov 2013 00:37:53 +0000 (00:37 +0000)]
Import the axge(4) driver for the ASIX AX88178A and AX88179 USB Ethernet
adapters. Both devices support Gigabit Ethernet and USB 2.0, and the AX88179
supports USB 3.0. The driver was written by kevlo@ and lwhsu@, with a few
bug fixes from me.

MFC after: 2 months

10 years agoNeed to also test for defined(${v}_${PROG})
sjg [Tue, 19 Nov 2013 00:34:59 +0000 (00:34 +0000)]
Need to also test for defined(${v}_${PROG})

10 years agoBump .Dd for recent change
eadler [Mon, 18 Nov 2013 23:11:42 +0000 (23:11 +0000)]
Bump .Dd for recent change

10 years agoAllow ethernet drivers to pass in packets connected via the nextpkt pointer.
gnn [Mon, 18 Nov 2013 22:58:14 +0000 (22:58 +0000)]
Allow ethernet drivers to pass in packets connected via the nextpkt pointer.
Handling packets in this way allows drivers to amortize work during packet reception.

Submitted by: Vijay Singh
Sponsored by: NetApp