Commit Graph

200057 Commits

Author SHA1 Message Date
jhb
c26ba28f12 MFC 287448:
Add more mmap tests related to character devices.
- Add cdev-related tests for bad args.
- Add two simple tests cases for mapping /dev/zero that test for
  MAP_ANON-like behavior.
2015-10-01 22:19:41 +00:00
jhb
40af7e45ad MFC 286370:
Add various tests to ensure that invalid arguments passed to mmap()
trigger failures.

Note: most of the tests that should provoke an EINVAL error do not
pass on stable/10 as stable/10 does not have the changes that added
more strict parameter checking to mmap().  Those changes will not be
merged to stable/10, so I have disabled them via #if 0 with a comment
explaining why.
2015-10-01 22:17:27 +00:00
jhb
875b574b15 MFC 286369:
Convert the map_at_zero test case to ATF.  In particular, this will
facilitate adding more mmap() tests.
2015-10-01 22:08:16 +00:00
jhb
ae84b42950 MFC 286177:
Fix a couple of markup typos.
2015-10-01 21:57:15 +00:00
jhb
f91b4f607a MFC 286256:
kgdb uses td_oncpu to determine if a thread is running and should use
a pcb from stoppcbs[] rather than the thread's PCB.  However, exited threads
retained td_oncpu from the last time they ran, and newborn threads had their
CPU fields cleared to zero during fork and thread creation since they are
in the set of fields zeroed when threads are setup.  To fix, explicitly
update the CPU fields for exiting threads in sched_throw() to reflect the
switch out and reset the CPU fields for new threads in sched_fork_thread()
to NOCPU.
2015-10-01 21:54:43 +00:00
jhb
3943d4df0c MFC 284175:
Handle X2APIC entries in the MADT for APICs with an ID < 255.  At least one
BIOS has been seen to include such entries even though the relevant specs
require that X2APIC entries only be used for CPUs with an APIC ID >= 255.

This was tested on a system with "plain" local APIC entries in the MADT
to ensure no regressions, but it has not yet been tested on a system with
X2APIC entries in the MADT.  Currently such systems do not boot at all,
and with this change they might now boot correctly.
2015-10-01 20:54:19 +00:00
jhb
31a6a8ed4c MFC 283121:
Use the proper mask when reloading sampling PMCs for Core CPUs.
2015-10-01 20:49:10 +00:00
jhb
050b8bd1a6 MFC 283624,283630:
Export a list of VM objects in the system via a sysctl.  The list can be
examined via 'vmstat -o'.  It can be used to determine which files are
using physical pages of memory and how much each is using.
2015-10-01 17:09:20 +00:00
gjb
a79133b7d5 MFC r288341, r288345, r288347:
r288341:
  Honor VMFORMATS and VMSIZE if set in release.conf. [1]

r288345:
  In followup to r288341, ensure VMFORMATS and VMSIZE are not
  set to empty values, which would result in nonintuitive build
  errors.

r288347:
  Append VMFORMATS and VMSIZE to RELEASE_RMAKEFLAGS only if
  WITH_VMIMAGES is set.

PR:		203420 [1]
Sponsored by:	The FreeBSD Foundation
2015-10-01 00:47:30 +00:00
delphij
702cf0edc4 MFC r287927:
Use strlcpy() instead of strncpy() because subsequent mkstemps expects
the string be nul-terminated.

Reviewed by:	neel
2015-10-01 00:44:45 +00:00
markj
1d526e254a MFC r288278:
Document the interface for applying advice up to the end of a file.
2015-09-30 03:36:41 +00:00
markj
0da2b55fba MFC r288276:
Fix argument ordering in vn_printf().
2015-09-30 03:35:58 +00:00
markj
8b8e712dff MFC r287806:
Preserve the device queue status before retrying a sense request in
chdone().
2015-09-30 03:33:28 +00:00
jhb
bbc4a5345e MFC 269727:
Update vmstat usage for last-argument count/wait parameters

Correct the usage in both the manpage and in usage() to indicate
that the wait interval and repetition count may be given either
with the respective -w/-c arguments, or as the final positional
arguments. [0]

The corresponding code to implement the positional arguments has
been conditional on the (always-enabled) BACKWARD_COMPATIBILITY
macro since the original 4.4-lite import.  It's no longer reasonable
to remove the functionality, so remove the macro and conditional
instead.

Note that multiple disks may be given on the command line.

While here, sort arguments and apply minor mdoc fixes.

PR:		184755 [0]
2015-09-30 00:11:06 +00:00
bdrewery
4432171c46 MFC r288154:
Similar to r266147, don't define PROG in the test subdirs.
2015-09-29 22:00:03 +00:00
bdrewery
9ee64225df MFC r288091:
vfs_mountroot_shuffle() never returns non-zero.
2015-09-29 21:54:09 +00:00
bdrewery
34455869c0 MFC r287979:
Remove redundant beforeinstall.
2015-09-29 21:47:50 +00:00
bdrewery
8808238003 MFC r287935:
Optimize makeman slightly by removing uneeded cat and extra test -s.
2015-09-29 21:45:23 +00:00
gjb
def912bcea Document SA-15:24.
Sponsored by:	The FreeBSD Foundation
2015-09-29 19:14:52 +00:00
jhb
7b63f549f4 MFC 283613,287374:
Use the cpuset API more consistently:
- Fetch the root set from cpuset_getaffinity() instead of assuming all CPUs
  from 0 to hw.ncpu are the root set.
- Use CPU_SETSIZE and CPU_FFS.
- The original notion of halted CPUs the manpage and code refers to is gone.
  Use the term "available" instead.
2015-09-29 18:39:58 +00:00
delphij
cfb7569733 The Sun RPC framework uses a netbuf structure to represent the
transport specific form of a universal transport address.  The
structure is expected to be opaque to consumers.  In the current
implementation, the structure contains a pointer to a buffer
that holds the actual address.

In rpcbind(8), netbuf structures are copied directly, which would
result in two netbuf structures that reference to one shared
address buffer.  When one of the two netbuf structures is freed,
access to the other netbuf structure would result in an undefined
result that may crash the rpcbind(8) daemon.

Fix this by making a copy of the buffer that is going to be freed
instead of doing a shallow copy.

Security:	FreeBSD-SA-15:24.rpcbind
Security:	CVE-2015-7236
2015-09-29 18:06:27 +00:00
bdrewery
f512c74c45 MFC r288092:
Avoid adding duplicates into OBJS.  bsd.lib.mk already handles adding entries
  to OBJS based on SRCS.
2015-09-29 16:56:28 +00:00
bdrewery
e664379a0e MFC r287978:
Fix LIBRARIES_ONLY
2015-09-29 16:54:22 +00:00
mav
27f4e553cd MFC r288111: Allow AHCI driver attach to all known chips reporting RAID class.
Reported by:	Michael BlackHeart <amdmiek@gmail.com>
2015-09-29 05:25:34 +00:00
mav
004f6fe71e MFC r287819: Make CAM log errors that make it wait.
Waiting can take minutes, and it would be good for user to know what is
going on.
2015-09-29 05:23:26 +00:00
delphij
2fecae512b MFC r287770: MFV r277429:
Document -S option when zfs inherit fails on quota and
in manual pages.

Illumos ZFS issues:

    5410 Document -S option to zfs inherit
    https://illumos.org/issues/5410

    5412 Mention -S option when zfs inherit fails on quota
    https://illumos.org/issues/5412

illumos/illumos-gate@5ff8cfa92e
2015-09-28 18:58:27 +00:00
mav
71c5cd08a3 MFC r287289: Attach pass driver to LUNs is OFFLINE state.
Previously such LUNs were silently ignored.  But while they indeed unable
to process most of SCSI commands, some, like RTPG, they still can.
2015-09-28 12:30:22 +00:00
alc
cf3ae90393 MFC r266588
There is no reason to perform the pmap_remove() on the kernel pmap while
  the kmem object lock is held.  Do the pmap_remove() before acquiring the
  kmem object lock.
2015-09-27 05:45:16 +00:00
alc
49ac252d07 MFC r283795
Document vm_page_alloc_contig()'s support for the VM_ALLOC_NODUMP option.
2015-09-27 05:26:22 +00:00
alc
1b04bd851b MFC r288025
Correct a non-fatal error in vm_pageout_worker().  vm_pageout_worker()
  should not assume that vm_pages_needed will remain set while it sleeps.
  Other threads can clear vm_pages_needed by performing a sufficient
  number of vm_page_free() calls, e.g., process termination.  The effect
  of this error was that vm_pageout_worker() would free and/or launder
  pages when, in fact, there was no shortage of free pages.

  Rewrite a nearby comment to describe all of the possible cases and not
  just the most common case.  The problem being that the comment made
  the most common case seem like the only case.
2015-09-27 04:47:08 +00:00
alc
40b680d8ca MFC r285282
The intention of r254304 was to scan the active queue continuously.
  However, I've observed the active queue scan stopping when there are
  frequent free page shortages and the inactive queue is steadily refilled
  by other mechanisms, such as the sequential access heuristic in vm_fault()
  or madvise(2).  To remedy this problem, record the time of the last active
  queue scan, and always scan a number of pages proportional to the time
  since the last scan, regardless of whether that last scan was a
  timeout-triggered ("pass == 0") or free-page-shortage-triggered ("pass >
  0") scan.

  Also, on a timeout-triggered scan, allow a full scan of the active queue
  when the system is short of inactive pages.
2015-09-27 04:36:09 +00:00
alc
ecb8678c0a MFC r286513, r286784
Revise the text about the atomicity of the defined operations across
  multiple processors.  In particular, clearly state that the operations
  are always atomic when they are applied to the default memory type
  that is used by the kernel (and applications).

  Stop describing an acquire operation as a read barrier and a release
  operation as a write barrier.  That description has never been correct,
  and it has caused confusion.

  Also, explicitly say that a thread doesn't see its own accesses being
  reordered.  The reordering of a thread's accesses is only (potentially)
  visible to another thread.
2015-09-27 04:25:07 +00:00
alc
0abc9d77e0 MFC r285428
Correct the description of MADV_DONTNEED.
2015-09-27 04:17:08 +00:00
kib
1e7a737734 MFC r288001:
Use tabs for indend.
2015-09-27 01:37:30 +00:00
alc
32fcd5e4dc MFC r287121
Testing whether a page is dirty does not require the page lock.
2015-09-27 01:35:32 +00:00
kib
b44e8c1443 MFC r288000:
Add support for weak symbols to the kernel linkers.
2015-09-27 01:33:43 +00:00
alc
8a6fcabbcf MFC r284654
Avoid pmap_is_modified() on pages that can't be mapped.
2015-09-27 01:26:41 +00:00
mav
5f3a8b9039 MFC r287747: Add ID for Intel Panther Point KT Controller
Found on ASUS P8Q77-M motherboard.

Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2015-09-27 01:19:42 +00:00
alc
88a31859bc MFC r287944
Eliminate (many) unnecessary calls to pmap_remove_all().
2015-09-27 01:15:17 +00:00
kib
d059c10283 MFC r288044:
Ensure that when a blockable open of fifo returns success, a valid
file descriptor opened for complimentary access exists as well.
2015-09-27 01:06:45 +00:00
cy
80ccd15a36 MFC r287674, r287675. Fix ipfilter bug 3600459 NAT bucket count wrong.
Obtained from:	ipfilter cvs repo r1.48.2.25
2015-09-26 03:51:53 +00:00
jkim
b7d943cea5 MFC: r288116
Remove unsupported S5 (power off) state.
2015-09-25 22:19:35 +00:00
jkim
1ac5c71d8b MFC: r267248, r267260, r267261, r267320
Document 'k' option for acpiconf(8).
2015-09-25 22:08:20 +00:00
jpaetzel
ca4140311b MFC 288208
Fix typo.

Sponsored by:	iXsystems
2015-09-25 03:54:10 +00:00
delphij
abaf4cee12 MFC r287650:
Use strlcpy() in favor of strncpy() as it's defined to have a nul character
at the end of string buffer, and the code context do expects this to behave
correctly (e.g. strchr).
2015-09-25 01:17:24 +00:00
emaste
a5313e9c06 MFC r286010: ar: enable deterministic mode by default
Ar cannot handle UIDs with more than 6 digits, and storing the mtime,
uid, gid and mode provides little to negative value anyhow for ar's
uses. Turn on deterministic (-D) mode by default; it can be disabled by
the user with -U.

Also MFC follow-on fixes in r286024 and r287324.

PR:		196929
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2015-09-25 00:23:36 +00:00
emaste
e828d62c47 MFC r274349: Add /usr/lib/debug directory to hier(7)
The canonical standalone debug directory established by the GNU
toolchain is /usr/lib/debug, and we use it when WITH_DEBUG_FILES is set.
Mention it in the file system hierarchy page.
2015-09-24 21:01:34 +00:00
emaste
2a0ca27245 MFC r279248: Unconditionally install debug directory hierarchy
This avoids various failure modes (e.g., when building and installing a
single binary with debug data on a system that otherwise does not have
it enabled).

It is also consistent with the way other directory hierarchies are
handled (e.g. share/man).
2015-09-24 20:56:26 +00:00
emaste
1867f50342 MFC r276636: add NT_PPC_VMX note type definition 2015-09-24 20:03:00 +00:00
emaste
6f0e49046f MFC r279698: Update the ELFOSABI_* constants.
Two new operating systems have been added in the meantime.
ELFOSABI_FENIXOS that uses value 16 (published in the latest draft) and
ELFOSABI_CLOUDABI that uses value 17 (to be published in the next draft).
2015-09-24 20:01:52 +00:00