Commit Graph

185668 Commits

Author SHA1 Message Date
Konstantin Belousov
79e9451f07 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
2013-11-20 09:03:48 +00:00
Konstantin Belousov
ff3ae454c0 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
2013-11-20 08:47:54 +00:00
Konstantin Belousov
7e14088d93 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
2013-11-20 08:45:26 +00:00
Don Lewis
a2c0f474c4 Regenerate after r258363 (alternate ID for Novatel MiFi 2200) and
r258333 (bus_autoconf.sh tweak).
2013-11-20 02:20:27 +00:00
Don Lewis
3ca52b0d34 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
2013-11-20 02:16:47 +00:00
Justin Hibbits
59d74a351f 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
2013-11-20 01:42:29 +00:00
Justin Hibbits
de950c79f3 Fix the function search space.
Submitted by:	Howard Su
2013-11-20 01:33:13 +00:00
Devin Teske
721819bedb Whitespace, style, sub-shells, and standardize variable name
(s/interfaces/menu_list/).
2013-11-20 00:17:57 +00:00
Zbigniew Bodek
a39370ff87 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
2013-11-19 23:37:50 +00:00
Zbigniew Bodek
5677154505 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
2013-11-19 23:31:39 +00:00
Andrey V. Elsukov
32cea4ca0f 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
2013-11-19 22:55:17 +00:00
Ian Lepore
19bc299f1c 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
2013-11-19 22:14:35 +00:00
Tom Rhodes
4c9e27bd0a "Tim trailing" -> "Trim trailing" 2013-11-19 19:55:41 +00:00
Andriy Gapon
4c47024ce0 taskqueue_cancel: garbage collect a write-only variable
MFC after:	3 days
2013-11-19 18:45:29 +00:00
Andriy Gapon
3fd7f7bef7 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
2013-11-19 18:43:47 +00:00
Andriy Gapon
d9b7800b54 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
2013-11-19 18:35:38 +00:00
Andriy Gapon
2f0f2d0f38 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
2013-11-19 18:35:01 +00:00
Dimitry Andric
110f993aa9 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
2013-11-19 17:53:19 +00:00
Bryan Drewery
5313966ea6 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
2013-11-19 16:11:03 +00:00
Bryan Drewery
d6ea27390b 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
2013-11-19 15:43:27 +00:00
Bryan Drewery
4cb272a079 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
2013-11-19 15:35:26 +00:00
Tijl Coosemans
11dc1c2af3 One more BIND remnant: /etc/mtree/BIND.chroot.dist
Discussed with:	des
2013-11-19 13:32:24 +00:00
Alexander Motin
c5068af559 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.
2013-11-19 11:19:07 +00:00
Alexander Motin
a2de44abf5 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.
2013-11-19 10:51:46 +00:00
Alexander Motin
4d104ba024 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.
2013-11-19 10:17:10 +00:00
Alexander Motin
f3932e9025 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.
2013-11-19 10:10:44 +00:00
Alexander Motin
ace66b568e 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.
2013-11-19 10:05:53 +00:00
Mark Johnston
adbed351b1 Provide the correct path to bus_autoconf.sh. 2013-11-19 00:43:53 +00:00
Mark Johnston
39be692974 Regenerate usb.conf after r258331. 2013-11-19 00:40:38 +00:00
Mark Johnston
da089c1410 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
2013-11-19 00:37:53 +00:00
Simon J. Gerraty
3bd40bb188 Need to also test for defined(${v}_${PROG}) 2013-11-19 00:34:59 +00:00
Eitan Adler
7dfb7dad8b Bump .Dd for recent change 2013-11-18 23:11:42 +00:00
George V. Neville-Neil
4857f5fbbc 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
2013-11-18 22:58:14 +00:00
Eitan Adler
c4dfa475ca Indicate which options are extensions to POSIX.
Inspired by:	DragonFlyBSD
2013-11-18 22:53:24 +00:00
Pedro F. Giffuni
6ca7e51c77 gcc: Record some previous commits in the gcc43 ChangeLog.
It is useful to update the ChangeLog with upstream references
related to our local r189824 and r255095.

MFC after:	3 weeks
2013-11-18 20:21:44 +00:00
Glen Barber
df6fb2b5b3 Simplify PKG_ABI for pkg-stage.sh.
Submitted by:	hrs
MFC after:	3 days
X-MFC-With:	r258310
Sponsored by:	The FreeBSD Foundation
2013-11-18 20:01:52 +00:00
Glen Barber
2b471d3acb Remove WITHOUT_PROFILE=1 for the dvd1.iso medium.
Requested by:	hrs
MFC after:	3 days
X-MFC-With:	r258310
Sponsored by:	The FreeBSD Foundation
2013-11-18 19:57:11 +00:00
Tijl Coosemans
7bfb173de1 Also delete lib32 libiconv.
Reported by:	Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
MFC after:	3 days
2013-11-18 19:13:38 +00:00
Glen Barber
d7cfbadb1b Document the 'dvdrom' target.
MFC after:	3 days
X-MFC-With:	r258310
Sponsored by:	The FreeBSD Foundation
2013-11-18 18:45:27 +00:00
Tijl Coosemans
204957ef5e Bug fixes in iconv(3) UTF-7 support.
- Add ' to the list of directly encoded characters and * to the list of
  optionally directly encoded characters as per RFC 2152.

- In _citrus_UTF7_mbtoutf16 on end of input when the next output character
  has only been partially decoded, save a copy of the buffer of input
  characters (not just its length).  On the next call with more input
  characters this buffer is reprocessed together with the new input to
  form a fully decoded output character.

- At the end of a base64 encoded sequence fully discard '-' (BASE64_OUT)
  by decrementing psenc->chlen and i.  This is needed to make room in
  psenc->ch (input buffer) in case the next input character starts a new
  base64 encoded sequence.  And also, if this is the end of input and no
  output character can be returned, this brings the encoder in the initial
  state as indicated by _citrus_UTF7_stdenc_get_state_desc_generic which
  is used by the caller to distinguish between no output and partial
  output.

- In _citrus_UTF7_mbrtowc_priv pass the s parameter (input pointer)
  directly to _citrus_UTF7_mbtoutf16 instead of a copy (s0).  This way s
  is updated correctly in case of errors.

- In _citrus_UTF7_mbrtowc_priv when called with psenc->surrogate set
  (previous call did not have enough input), retrieve the previously
  decoded UTF-16 character from (psenc->cache >> psenc->bits) instead of
  (psenc->cache >> 2).

MFC after:	5 days
2013-11-18 18:14:23 +00:00
Glen Barber
6d86d28981 Fix how ABI is evaluated so it matches more than a dot-zero
case.

MFC after:	3 days
X-MFC-With:	r258310
Sponsored by:	The FreeBSD Foundation
2013-11-18 17:52:18 +00:00
Alan Somers
1f9e80bcdb opensolaris/uts/common/dtrace/fasttrap.c
Fix several problems that can cause panics on kldload and kldunload.

	* kproc_create(fasttrap_pid_cleanup_cb, ...) gets called before
	  fasttrap_provs.fth_table gets allocated.  This can lead to a panic
	  on module load, because fasttrap_pid_cleanup_cb references
	  fasttrap_provs.fth_table.  Move kproc_create down after the point
	  that fasttrap_provs.fth_table gets allocated, and modify the error
	  handling accordingly.

	* dtrace_fasttrap_{fork,exec,exit} weren't getting NULLed until
	  after fasttrap_provs.fth_table got freed.  That caused panics on
	  module unload because fasttrap_exec_exit calls
	  fasttrap_provider_retire, which references
	  fasttrap_provs.fth_table.  NULL those function pointers earlier.

	* There wasn't any code to destroy the
	  fasttrap_{tpoints,provs,procs}.fth_table mutexes on module unload,
	  leading to a resource leak when WITNESS is enabled.  Destroy those
	  mutexes during fasttrap_unload().

Reviewed by:	markj
Approved by:	ken (mentor)
Sponsored by:	Spectra Logic
MFC after:	4 weeks
2013-11-18 16:51:56 +00:00
Glen Barber
dc2445625a Add the 'dvd1.iso' target. This mimics the 'release.iso' target,
with the additional step of fetching packages for inclusion on the
dvd image.

The 'pkg-stage' target is used to run 'scripts/pkg-stage.sh' if
the '${TARGET}/pkg-stage.conf' configuration file exists (currently
only amd64 and i386).

Allow dvd1.iso to be skipped if NODVD=1.

MFC after:	3 days
X-MFC-With:	r258305, r258307, r258308, r258309
Sponsored by:	The FreeBSD Foundation
2013-11-18 16:25:56 +00:00
Glen Barber
1d9e5a791b Set the PKG_CACHEDIR directory to 'dvd/' instead of 'release/'
in preparation of adding a 'dvd1.iso' target.

MFC after:	3 days
X-MFC-With:	r258305, r258307, r258308
Sponsored by:	The FreeBSD Foundation
2013-11-18 16:11:19 +00:00
Glen Barber
98e83c53af Unconditionally copy the build host /etc/resolv.conf into
the chroot directory, since hostname resolution may be
needed in the case of building a dvd image (with packages)
and also setting 'NOPORTS=1'.

MFC after:	3 days
X-MFC-With:	r258305, r258307
Sponsored by:	The FreeBSD Foundation
2013-11-18 16:04:04 +00:00
Glen Barber
042a51f641 Add a script and configuration files to fetch pre-built packages
from pkg.FreeBSD.org for inclusion on release medium (dvd1.iso).

The script sources ${.CURDIR}/${TARGET}/pkg-stage.conf, which sets
several environment variables, such as the pkg(8) ABI, PACKAGESITE,
PKG_DBDIR, and PKG_CACHEDIR.  PKG_CACHEDIR is set to the directory
on the release medium used by bsdconfig(8) (/packages/${ABI}).  ABI
is determined by output of 'make -C /usr/src/release -V REVISION'.
See pkg.conf(5) for descripton on other variables set here.

The list of packages to include are set within the configuration
file.

The script and configuration files are intended to be run by the
'make dvd' target within the release directory, and assume the
release is built within a chroot environment (such as by using
release.sh).

Relevant updates to release/Makefile will follow.

Sponsored by:	The FreeBSD Foundation
2013-11-18 15:22:55 +00:00
Glen Barber
849861d03f Use the IMAGES variable to determine which image files to remove
as part of 'make -C /usr/src/release clean'.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2013-11-18 15:11:13 +00:00
Julio Merino
21203fdd06 Add some sample test programs.
This change adds some sample test cases to share/examples/tests/
demonstrating the basic usage of the atf and plain interfaces.

These test programs are fully-functional and are installed as part
of the test suite, which guarantees that the sample code remains
correct.  However, they currently mostly serve as a placeholder for
additional examples and may be incomplete (depending on how you
look at them).  I will see what else can be useful while working on
documentation.

As a bonus, the addition of these tests exercise the *.test.mk files,
one of which (plain.test.mk) was not yet in use, and also demonstrates
that it's possible to mix different kinds of test programs into the
same test suite.

Approved by:	rpaulo (mentor)
2013-11-18 12:57:46 +00:00
Julio Merino
a2b5b37cb7 Fix the build of plain test programs.
SRCS.<prog> must be explicitly defined when using the PROGS* functionality
for each program to be built.

As there are no plain test programs in the system yet, this was not
detected.

Approved by:	rpaulo (mentor)
2013-11-18 12:47:35 +00:00
Julio Merino
4e6b339397 Remove registration of C++ test programs into PROGS.
C++ programs need to be added to PROGS_CXX, not PROGS, and the code was
actually doing both.  Just keep the registration into PROGS_CXX to
prevent possible obscure build problems.

Approved by:	rpaulo (mentor)
2013-11-18 12:44:05 +00:00