Commit Graph
218283 Commits
Author SHA1 Message Date
Enji Cooper 17b66b68c3 MFC r324143:
Adjust r322633 to only apply to libexec/rtld-elf, and not usr.bin/ldd,
when running build32/install32

This unbreaks installing usr.bin/ldd as ldd32 when NO_RTLD is defined.

MFC with:       r322633
2017-10-07 18:46:50 +00:00
Alan Cox ca2170c820 MFC r319542,321003,321378
Eliminate duplication of the pmap and pv list unlock operations in
  pmap_enter() by implementing a single return path.  Otherwise, the
  duplication will only increase with the upcoming support for psind == 1.

  Extract the innermost loop of pmap_remove() out into its own function,
  pmap_remove_ptes().  (This new function will also be used by an upcoming
  change to pmap_enter() that adds support for psind == 1 mappings.)

  Add support for pmap_enter(..., psind=1) to the amd64 pmap.  In other words,
  add support for explicitly requesting that pmap_enter() create a 2MB page
  mapping.  (Essentially, this feature allows the machine-independent layer to
  create superpage mappings preemptively, and not wait for automatic promotion
  to occur.)

  Export pmap_ps_enabled() to the machine-independent layer.

  Add a flag to pmap_pv_insert_pde() that specifies whether it should fail or
  reclaim a PV entry when one is not available.

  Refactor pmap_enter_pde() into two functions, one by the same name, that is
  a general-purpose function for creating PDE PG_PS mappings, and another,
  pmap_enter_2mpage(), that is used to prefault 2MB read- and/or execute-only
  mappings for execve(2), mmap(2), and shmat(2).
2017-10-07 18:36:42 +00:00
Alan Cox c695e16572 MFC r320980,321377
Generalize vm_page_ps_is_valid() to support testing other predicates on
  the (super)page, renaming the function to vm_page_ps_test().

  In vm_page_ps_test(), always check that the base pages within the specified
  superpage all belong to the same object.  To date, that check has not been
  needed, but upcoming changes require it.
2017-10-07 18:08:37 +00:00
Alan Cox 02f2996b15 MFC r321015
Style-only change: Consistently use the variable name "pdpg" throughout
  this file.  Previously, half of the pointers to a vm_page being used as
  a page directory page were named "pdpg" and the rest were named "mpde".
2017-10-07 17:32:39 +00:00
Alan Cox 0bdef48970 MFC r323973,324087
Optimize vm_page_try_to_free().  Specifically, the call to pmap_remove_all()
  can be avoided when the page's containing object has a reference count of
  zero.  (If the object has a reference count of zero, then none of its pages
  can possibly be mapped.)

  Address nearby style issues in vm_page_try_to_free(), and change its
  return type to "bool".

  Optimize vm_object_page_remove() by eliminating pointless calls to
  pmap_remove_all().  If the object to which a page belongs has no
  references, then that page cannot possibly be mapped.
2017-10-07 17:20:31 +00:00
Alan Cox f7bcbb5b7e MFC r323656
Modify blst_leaf_alloc to take only the cursor argument.

  Modify blst_leaf_alloc to find allocations that cross the boundary between
  one leaf node and the next when those two leaves descend from the same
  meta node.

  Update the hint field for leaves so that it represents a bound on how
  large an allocation can begin in that leaf, where it currently represents
  a bound on how large an allocation can be found within the boundaries of
  the leaf.

  The first phase of blst_leaf_alloc currently shrinks sequences of
  consecutive 1-bits in mask until each has been shrunken by count-1 bits,
  so that any bits remaining show where an allocation can begin, or until
  all the bits have disappeared, in which case the allocation fails. This
  change amends that so that the high-order bit is copied, as if, when the
  last block was free, it was followed by an endless stream of free
  blocks. It also amends the early stopping condition, so that the shrinking
  of 1-sequences stops early when there are none, or there is only one
  unbounded one remaining.

  The search for the first set bit is unchanged, and the code path
  thereafter is mostly unchanged unless the first set bit is in a position
  that makes some of those copied sign bits matter. In that case, we look
  for a next leaf, and at what blocks it can provide, to see if a
  cross-boundary allocation is possible.

  The hint is updated on a successful allocation that clears the last bit,
  but it not updated on a failed allocation that leaves the last bit
  set. So, as long as the last block is free, the hint value for the leaf is
  large. As long as the last block is free, and there's a next leaf, a large
  allocation can begin here, perhaps. A stricter rule than this would mean
  that allocations and frees in one leaf could require hint updates to the
  preceding leaf, and this change seeks to leave the freeing code
  unmodified.

  Define BLIST_BMAP_MASK, and use it for bit masking in blst_leaf_free and
  blist_leaf_fill, as well as in blst_leaf_alloc.

  Correct a panic message in blst_leaf_free.
2017-10-07 16:55:44 +00:00
Alexander Motin 2b7d1db707 MFC r324123: Add sysctl/tunable for maximal request time. 2017-10-07 09:47:31 +00:00
Konstantin Belousov d219e6c97e MFC r324114:
Update cpucontrol(8).
2017-10-07 08:44:08 +00:00
Konstantin Belousov b5e3c27a3e MFC r324113:
Allow to disable default microcode updates search path with the new
'-n' option.
2017-10-07 08:42:36 +00:00
David C Somayajulu c8f1a0fb6f MFC r324065
Tx Ring Shadow Consumer Index Register needs to be cleared prior
to passing it's physical address to the FW during Tx Create Context.
2017-10-05 18:38:42 +00:00
David C Somayajulu 07290a7bd2 MFC r324026
Fix delete all multicast addresses

Submitted by:[email protected]
2017-10-05 18:33:56 +00:00
Gordon Tetlow 4fc778d810 MFC r323709:
Revert tcpdump to using the source manpage instead of having a copy here.

This helps future maintainability of tcpdump so we don't forget to update
the manpage (like we have previously).
2017-10-05 17:02:21 +00:00
Konstantin Belousov 93abe18573 MFC r324080:
Zero segment registers which contained invalid usermode selectors, when
returning to kernel.
2017-10-05 11:01:19 +00:00
Konstantin Belousov c794bd2b88 MFC r324079:
Do not return from interrupt using the POP_FRAME;iret instruction
sequence, always jump to doreti.
2017-10-05 11:00:04 +00:00
Alexander Motin 31c20eb549 MFC r324086: Alike to ZFS disable cache flush after first ENOTSUP error. 2017-10-05 10:24:34 +00:00
Andriy Gapon ae54382817 MFC r323578,r323769: dounmount: do not release the mount point's reference
on the covered vnode

As long as mnt_ref is not zero there can be a consumer that might try
to access mnt_vnodecovered.  For this reason the covered vnode must not
be freed until mnt_ref goes to zero.
So, move the release of the covered vnode to vfs_mount_destroy.
2017-10-05 06:54:25 +00:00
Mark Johnston 83fd2ad5c9 MFC r324066:
Use C99 initializers for DTrace provider methods.
2017-10-04 15:47:16 +00:00
Edward Tomasz Napierala 9c8d5fde40 MFC r320892:
Make fsck_y_enable default to passing pass -R to fsck_ffs(8) in addition
to -y.  To me, fsck_y_enable means "try as hard as possible", and without
-R, it... well, doesn't.
2017-10-04 12:06:24 +00:00
Edward Tomasz Napierala 141c06dff8 MFC r320803:
Fix "mount -uw /" when the filesystem type doesn't match.

This basically makes "mount -uw /" work when the filesystem
mounted on / is NFS, but the one configured in fstab(5) is UFS,
which can happen when you forget to modify fstab.

Note that the whole special case ("else if (argv[0][0] == '/'")
is probably not needed anyway.  I'll take a look at removing it
altogether; for now this is a minimally intrusive fix.
2017-10-04 12:04:35 +00:00
Edward Tomasz Napierala 16375ed535 MFC r323263:
Hint that the "-o emul" option for ps(1) shows the ABI.
2017-10-04 12:02:42 +00:00
Edward Tomasz Napierala 3f3f5dffb6 MFC r323228:
Make ps(1) flag processes in capsicum(4) capability mode with "C".
2017-10-04 12:02:05 +00:00
Edward Tomasz Napierala dba2b6ea2d MFC r323225:
Reflect realtime and idle priorities in ps(1) state flags, same like
we do for the usual nice values.  It could be argued that they should
use another set of indicators, since the underlying mechanism is
different, but they match the description in the manual page, and so
I think it's ok to not overcomplicate things.

PR:		81757
2017-10-04 12:01:02 +00:00
Edward Tomasz Napierala 6a01afa8c1 MFC r321422:
Improve the ktrace(1) man page to make it slightly more obvious that there
are _two_ options that control its behaviour wrt child processes; slightly
improve the example[1], and add Xrefs.
2017-10-04 11:59:53 +00:00
Edward Tomasz Napierala 5e535255aa MFC r323183:
Make root_mount_rel(9) ignore NULL arguments, like it used to before r313351.
It would be better to fix API consumers to not pass NULL there - most of them,
such as gmirror, already contain the neccessary checks - but this is easier
and much less error-prone.

One known user-visible result is that it fixes panic on a failed "graid label".
2017-10-04 11:58:52 +00:00
Edward Tomasz Napierala 2b825af1be MFC r320734:
Improve ddb(4) error reporting a bit.
2017-10-04 11:55:34 +00:00
Edward Tomasz Napierala 226a4bee8a MFC r320740:
Make ^w work in ddb(4).
2017-10-04 11:54:15 +00:00
Edward Tomasz Napierala 06f3aaffed MFC r320733:
Make ddb(4) a bit more user-friendly by improving "help".
2017-10-04 11:53:05 +00:00
Edward Tomasz Napierala a690c31245 MFC r320741:
Make ^c work in ddb(4).
2017-10-04 11:42:12 +00:00
Edward Tomasz Napierala f479096c4c MFC r320363:
Improve terminology in a comment.
2017-10-04 11:39:44 +00:00
Edward Tomasz Napierala 9dcf016695 MFC r320360:
Make resizewin(1) do flushing by using TCSAFLUSH instead of TCSANOW
followed by tcflush(3).  This works just as well and is more elegant.
2017-10-04 11:38:52 +00:00
Andriy Gapon 86e88e69ac MFC r323791: MFV r323790: 8567 Inconsistent return value in zpool_read_label 2017-10-04 07:43:04 +00:00
Andriy Gapon e742363e7d MFC r323483: zfsctl_snapdir_lookup should be able to handle an uncovered vnode 2017-10-04 07:37:36 +00:00
Andriy Gapon 4016b773f8 MFC r323481: zfsvfs_hold: assert that the busied filesystem can not be unmounted 2017-10-04 07:36:06 +00:00
Ed Schouten 9e46278001 MFC r321514, r322885, r323015, r323177
This brings the CloudABI code more or less in sync with HEAD.

r321514:
Upgrade to the latest sources generated from the CloudABI specification.

The CloudABI specification has had some minor changes over the last half
year. No substantial features have been added, but some features that
are deemed unnecessary in retrospect have been removed:

- mlock()/munlock():

  These calls tend to be used for two different purposes: real-time
  support and handling of sensitive (cryptographic) material that
  shouldn't end up in swap. The former use case is out of scope for
  CloudABI. The latter may also be handled by encrypting swap.

  Removing this has the advantage that we no longer need to worry about
  having resource limits put in place.

- SOCK_SEQPACKET:

  Support for SOCK_SEQPACKET is rather inconsistent across various
  operating systems. Some operating systems supported by CloudABI (e.g.,
  macOS) don't support it at all. Considering that they are rarely used,
  remove support for the time being.

- getsockname(), getpeername(), etc.:

  A shortcoming of the sockets API is that it doesn't allow you to
  create socket(pair)s, having fake socket addresses associated with
  them. This makes it harder to test applications or transparently
  forward (proxy) connections to them.

  With CloudABI, we're slowly moving networking connectivity into a
  separate daemon called Flower. In addition to passing around socket
  file descriptors, this daemon provides address information in the form
  of arbitrary string labels. There is thus no longer any need for
  requesting socket address information from the kernel itself.

This change also updates consumers of the generated code accordingly.
Even though system calls end up getting renumbered, this won't cause any
problems in practice. CloudABI programs always call into the kernel
through a kernel-supplied vDSO that has the numbers updated as well.

Obtained from:	https://github.com/NuxiNL/cloudabi

r322885:
Sync CloudABI compatibility against the latest upstream version (v0.13).

With Flower (CloudABI's network connection daemon) becoming more
complete, there is no longer any need for creating any unconnected
sockets. Socket pairs in combination with file descriptor passing is all
that is necessary, as that is what is used by Flower to pass network
connections from the public internet to listening processes.

Remove all of the kernel bits that were used to implement socket(),
listen(), bindat() and connectat(). In principle, accept() and
SO_ACCEPTCONN may also be removed, but there are still some consumers
left.

Obtained from:	https://github.com/NuxiNL/cloudabi

r323015:
Complete the CloudABI networking refactoring.

Now that all of the packaged software has been adjusted to either use
Flower (https://github.com/NuxiNL/flower) for making incoming/outgoing
network connections or can have connections injected, there is no longer
need to keep accept() around. It is now a lot easier to write networked
services that are address family independent, dual-stack, testable, etc.

Remove all of the bits related to accept(), but also to
getsockopt(SO_ACCEPTCONN).

r323177:
Merge pipes and socket pairs.

Now that CloudABI's sockets API has been changed to be addressless and
only connected socket instances are used (e.g., socket pairs), they have
become fairly similar to pipes. The only differences on CloudABI is that
socket pairs additionally support shutdown(), send() and recv().

To simplify the ABI, we've therefore decided to remove pipes as a
separate file descriptor type and just let pipe() return a socket pair
of type SOCK_STREAM. S_ISFIFO() and S_ISSOCK() are now defined
identically.
2017-10-04 07:35:01 +00:00
Konstantin Belousov 1a6fa4bfe3 MFC r323768:
For unlinked files, do not msync(2) or sync on the vnode deactivation.
2017-10-03 11:00:34 +00:00
Emmanuel Vadot 326553956c MFC r324007, r324012, r324014
r324007:
mountd: Replace malloc+strcpy to strdup

Reviewed by:	bapt
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D12503

r324012:
mountd: Remove unneeded cast

Reported by:	kib
X MFC With:	r324007

r324014:
mountd: Avoid memory leak by freeing dp_dirp

Introduced in r324007, the data alloced by strdup was never free'ed.
While here, remove cast to caddr_t when freeing dp.

Reported by:	bde
X MFC With:	r324007
2017-10-03 08:29:46 +00:00
Baptiste Daroussin 75993e7be3 MFC r324100:
man(1): silent the output of mandoc when testing

This reduce the spam a user may face when mandoc tries to
figure out if it can renders a manpage or fallback on groff(1)

Reported by:	bdrewery
2017-10-03 08:14:25 +00:00
John Baldwin 27b469bc9e MFC 323994: Log signal number passed to PT_STEP requests in KTR_PTRACE traces. 2017-10-02 18:03:55 +00:00
Andriy Gapon bb0bd572b3 MFC r323433,r323793,r323915: MFV r323110: 8558 lwp_create() returns EAGAIN
on system with more than 80K ZFS filesystems, and followups

r323433: MFV r323110: 8558 lwp_create() returns EAGAIN on system with more than 80K ZFS filesystems
r323793: MFV r323792: 8602 remove unused "dp_early_sync_tasks" field from "dsl_pool" structure
r323915: MFV r323914: 8661 remove "zil-cw2" dtrace probe
2017-10-02 12:54:01 +00:00
Andriy Gapon c2c13b248b MFC r323918: MFV r323917: 8648 Fix range locking in ZIL commit codepath
This fixes a problem introduced in r315441, MFC of r308782.
2017-10-02 12:44:06 +00:00
Rick Macklem 1d688c6340 MFC: r323689
Fix bogus FREAD with NFSV4OPEN_ACCESSREAD. No functional change.

The code in nfscl_doflayoutio() bogusly used FREAD instead of
NFSV4OPEN_ACCESSREAD. Since both happen to be defined as "1", this
worked and the patch doesn't result in a functional change.
Found by inspection during development of Flex File Layout support.
2017-10-01 21:45:15 +00:00
Eugene Grosbein aad6503df6 MFC r323873, r324081: Unprotected modification of ng_iface(4)
private data leads to kernel panic. Fix a race with per-node
read-mostly lock and refcounting for a hook.

PR:			220076
Tested by:		peixoto.cassiano
Approved by:		mav (mentor)
Relnotes:		yes
Differential Revision:	https://reviews.freebsd.org/D12435
2017-10-01 19:39:27 +00:00
Alan Cox ce20380357 MFC r323961
Since the page "frame" doesn't belong to a vm object, it can't be paged
  out.  Since it can't be paged out, it is never actually enqueued in a
  paging queue.  Nonetheless, passing PQ_INACTIVE to vm_page_unwire()
  creates the appearance that the page "frame" is being enqueued in the
  inactive queue.  As of r288122, we can avoid this false impression by
  passing PQ_NONE.
2017-10-01 16:57:08 +00:00
Alan Cox 708f3de460 MFC r323981
Modernize the use of vm_page_unwire().  Since r288122, vm_page_unwire()
  has returned TRUE when the wire count transitions to zero, eliminating
  the need for callers to inspect the page's wire count.
2017-10-01 16:29:20 +00:00
Andriy Gapon fdeb553ebe MFV r323796: fix memory leak in g_bio zone introduced in r320452
I overlooked the fact that that ZIO_IOCTL_PIPELINE does not include
ZIO_STAGE_VDEV_IO_DONE stage.  We do allocate a struct bio for an ioctl
zio (a disk cache flush), but we never freed it.

This change splits bio handling into two groups, one for normal
read/write i/o that passes data around and, thus, needs the abd data
tranform; the other group is for "data-less" i/o such as trim and cache
flush.

PR:		222288
2017-10-01 15:03:44 +00:00
Andriy Gapon 19adfcd98a MFC r323797: add vfs_zfs.abd_chunk_size tunable
It is reported that the default value of 4KB results in a substantial
memory use overhead (at least, on some configurations).  Using 1KB seems
to reduce the overhead significantly.

PR:		222377
2017-10-01 14:58:43 +00:00
Andriy Gapon 80254c5416 MFC r323522: slightly simplify zfs_vptocnp 2017-10-01 14:50:01 +00:00
Enji Cooper 2fa4047198 MFC r321444,r321446:
r321444:

Remove ${MTREE} and leverage etc/mtree/Makefile instead with
"make distribution".

This also fixes the fact that BSD.debug.dist was being installed if/when
${MK_DEBUG_FILES} != "no" before this commit.

r321446:

Unconditionally install etc/mtree/BSD.debug.dist again

r279248 unconditionally installed BSD.debug.dist for ease-of-developer-use.
Restore the previous behavior.

While here, add a comment to note that this is intentional to avoid accidental
future removal.

MFC with:	r321444
2017-09-30 20:31:37 +00:00
Enji Cooper 40bbc28b47 MFC r322441:
Delete trailing whitespace
2017-09-30 20:07:54 +00:00
Enji Cooper 13fe192962 MFC r322951:
Respect MK_TCSH with build-tools and native-xtools

This helps reduce the WORLDTMP footprint slightly.

Based on a patch I submitted 5 years ago to GNATS.

PR:		174051
Relnotes:	yes (anyone who cross-builds with MK_TCSH=yes will run into
		     build failures if the host doesn't have tcsh(1))
Reminded by:	Fabian Keil <[email protected]>
2017-09-30 20:06:44 +00:00