196205 Commits

Author SHA1 Message Date
markj
f850608aee MFC r264434:
DTrace's pid provider works by inserting breakpoint instructions at probe
sites and installing a hook at the kernel's trap handler. The fasttrap code
will emulate the overwritten instruction in some common cases, but otherwise
copies it out into some scratch space in the traced process' address space
and ensures that it's executed after returning from the trap.

In Solaris and illumos, this (per-thread) scratch space comes from some
reserved space in TLS, accessible via the fs segment register. This
approach is somewhat unappealing on FreeBSD since it would require some
modifications to rtld and jemalloc (for static TLS) to ensure that TLS is
executable, and would thus introduce dependencies on their implementation
details. I think it would also be impossible to safely trace static binaries
compiled without these modifications.

This change implements the functionality in a different way, by having
fasttrap map pages into the target process' address space on demand. Each
page is divided into 64-byte chunks for use by individual threads, and
fasttrap's process descriptor struct has been extended to keep track of
any scratch space allocated for the corresponding process.

With this change it's possible to trace all libc functions in a program,
e.g. with

  pid$target:libc.so.*::entry {@[probefunc] = count();}

Previously this would generally cause the victim process to crash, as
tracing memcpy on amd64 requires the functionality described above.
2014-07-31 17:10:03 +00:00
wblock
d357493f14 MFC 268931:
Correct spelling errors in ctld.8.  While here, correct similar errors
in ctl.conf.5 and fix a couple of contractions.
2014-07-31 14:53:07 +00:00
rpaulo
815311c5b9 MFC r268300:
bsd.dep.mk: add support for generating DTrace header files from .d
 files.
2014-07-31 07:27:59 +00:00
mav
375621a9a5 MFC r268808:
Increase maximal number of SCSI ports in CTL from 32 to 128.

After I gave each iSCSI target its own port, the old limit appeared to be
not so big.  This change almost proportionally increases per-LUN memory
use, but it is still three times better then it was before r268807.
2014-07-30 07:21:30 +00:00
mav
16407addf1 MFC r268807:
Reduce per-LUN memory usage from 18MB to 1.8MB.

CTL never had use for CA support code since SPI has gone, and there is no
even frontends supporting that.  But it still was reserving 256 bytes of
memory per LUN per every possible initiator on every possible port.

Wrap unused code with ifdef's in case somebody ever need it.
2014-07-30 07:20:36 +00:00
mav
dd34ac0859 MFC r268767:
Add support for VMWare dialect of EXTENDED COPY command, aka VAAI Clone.

This allows to clone VMs and move them between LUNs inside one storage
host without generating extra network traffic to the initiator and back,
and without being limited by network bandwidth.

LUNs participating in copy operation should have UNIQUE NAA or EUI IDs set.
For LUNs without these IDs VMWare will use traditional copy operations.

Beware: the above LUN IDs explicitly set to values non-unique from the VM
cluster point of view may cause data corruption if wrong LUN is addressed!

Sponsored by:	iXsystems, Inc.
2014-07-30 07:18:32 +00:00
mav
1c2891173e MFC r268581:
Merge several equal serialization indexes.
2014-07-30 07:16:08 +00:00
mav
9418843a93 MFC r269149:
Fix several cases of NULL dereference when INQUIRY sent to absent LUN.
2014-07-30 07:08:59 +00:00
kib
a1ca36e775 MFC r269160:
Remove man page for non-existent VOPs.

MFC r269240 (by pluknet):
Add VOP_GETVOBJECT.9 to obsolete files, un-xref.
2014-07-30 04:03:59 +00:00
kib
68a7483c94 MFC r269159:
Correct the locking statement.

MFC r269161:
Explicitely mention that inactivated or reclaimed vnode is locked
exclusively.
2014-07-30 04:00:23 +00:00
kib
f3b6e2c4bd MFC r268765:
Remove unused header.
2014-07-30 03:58:29 +00:00
kib
4af1d57b25 MFC r268764:
Check for the cross-device cross-link attempt in the VFS, instead of
VOP_LINK() implemenations.
2014-07-30 03:56:17 +00:00
markj
7c889ea487 MFC r265276:
Fix a typo.
2014-07-29 22:29:31 +00:00
markj
5f27eb902d MFC r264435:
Ensure that all eight syscall arguments are available to dtrace_probe(),
rather than just the first five.
2014-07-29 22:26:41 +00:00
hselasky
4f201ea793 MFC r268929:
Add new device ID.

PR:		191959
2014-07-29 22:05:33 +00:00
hselasky
74a1368a59 MFC r269127:
Fix for division by zero.
2014-07-29 21:59:24 +00:00
markj
c7af226b37 MFC r264486:
Use the correct format specifiers for wide characters and strings of wide
characters.
2014-07-29 21:21:16 +00:00
markj
cf4dd8790b MFC r268446:
Fix a typo.
2014-07-29 21:15:26 +00:00
rmacklem
d6fd29cba9 MFC: r268726
Move the "retry:" label so that the calls to m_pullup() are
not done after the call to m_defrag(). This fixes a problem
where m_pullup() would prepend an mbuf to the list created
by m_defrag() making the chain greater than 32 again.
2014-07-29 21:05:51 +00:00
des
fe6d937978 MFH (r266114, r266138): upgrade to latest ldns and unbound
MFH (r266139-r266143, r266145, r266149, r266150): fix props
MFH (r266179, r266180, r266193, r266238, r266777): misc cleanup
MFH (r266863): create and use /var/unbound/conf.d
MFH (r268839): import unblock-lan-zones patch from upstream
MFH (r268840): fix reverse lookups on private networks
MFH (r268883): avoid spamming source tree during build

PR:		190739 (for r268883)
2014-07-29 20:57:38 +00:00
markj
1f52ac9340 MFC r264363:
Update the SDT(9) example to reflect the removal of the sname parameter
in r258622.
2014-07-29 20:37:22 +00:00
markj
8116ff7597 MFC r263329:
Only invoke fasttrap hooks for traps from user mode, and ensure that they're
called with interrupts enabled. Calling fasttrap_pid_probe() with interrupts
disabled can lead to deadlock if fasttrap writes to the process' address
space.
2014-07-29 20:33:18 +00:00
markj
2bf1f15393 MFC r262669:
When our linker merges .SUNW_dof sections from multiple files, it simply
concatenates the DOF tables into one section. Previously, the USDT init
code in drti.o would only look at the first table in the DOF section; with
this change, it iterates over all the tables, passing each DOF table to
the kernel.

PR:	186821
2014-07-29 18:31:27 +00:00
marius
6b4298527d MFC: r269051
Copying pages via temporary mappings in the !DMAP case of pmap_copy_pages()
involves updating the corresponding page tables followed by accesses to the
pages in question. This sequence is subject to the situation exactly described
in the "AMD64 Architecture Programmer's Manual Volume 2: System Programming"
rev. 3.23, "7.3.1 Special Coherency Considerations" [1, p. 171 f.]. Therefore,
issuing the INVLPG right after modifying the PTE bits is crucial (see also
r269050, MFCed to stable/10 in r269235).
For the amd64 PMAP code, the order of instructions was already correct. The
above fact still is worth documenting, though.

1: http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/24593_APM_v21.pdf

Reviewed by:	alc
Sponsored by:	Bally Wulff Games & Entertainment GmbH
2014-07-29 13:11:37 +00:00
marius
4f9788cb2b MFC: r269050
- Copying and zeroing pages via temporary mappings involves updating the
  corresponding page tables followed by accesses to the pages in question.
  This sequence is subject to the situation exactly described in the "AMD64
  Architecture Programmer's Manual Volume 2: System Programming" rev. 3.23,
  "7.3.1 Special Coherency Considerations" [1, p. 171 f.]. Therefore, issuing
  the INVLPG right after modifying the PTE bits is crucial.
  For pmap_copy_page(), this has been broken in r124956 and later on carried
  over to pmap_copy_pages() derived from the former, while all other places
  in the i386 PMAP code use the correct order of instructions in this regard.
  Fixing the latter breakage solves the problem of data corruption seen with
  unmapped I/O enabled when running at least bare metal on AMD R-268D APUs.
  However, this might also fix similar corruption reported for virtualized
  environments.
- In pmap_copy_pages(), correctly set the cache bits on the source page being
  copied. This change is thought to be a NOP for the real world, though. [2]

1: http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/24593_APM_v21.pdf

Submitted by:	kib [2]
Reviewed by:	alc, kib
Sponsored by:	Bally Wulff Games & Entertainment GmbH
2014-07-29 13:08:37 +00:00
mav
e6ff5c766b MFC r269122:
Fix infinite loop, when doing WRITE SAME on file-backed LUN.
2014-07-29 07:40:14 +00:00
pluknet
2dfd8b7dad MFC r268727 (by delphij):
Add a bandaid to fix GCC build (on sparc64 et al).
2014-07-29 07:36:38 +00:00
delphij
971decf64b MFC r268979:
Don't save entropy inside jails.

As of r126744, we no longer feed the entropy device in jails upon
start, and collecting them is no longer useful.

PR:		conf/126744
Submitted by:	Eugene Grosbein <eugen grosbein net> (with minor changes)
Approved by:	so (des)
2014-07-29 06:00:16 +00:00
delphij
2c88e211d5 MFC r268720: MFV r268714:
Improve extreme rewind import.

When doing an "extreme rewind" import ("zpool import -XF"), we attempt
to verify all data in the pool, essentially scrubbing the entire pool.
The problem is that spa_load_verify_cb() issues an unbounded number of
concurrent scrub i/os.  This can lead to all of memory being used for
these zio's, wedging the system. Like normal scrub, we need to put a
cap on the number of outstanding i/os, and have the traverse thread
block when we reach this cap.

For this purpose the cap can be very large (10,000) to optimize the
elevator algorithm.  Three kernel tunables have been added:

	vfs.zfs.spa_load_verify_maxinflight
	vfs.zfs.spa_load_verify_metadata
	vfs.zfs.spa_load_verify_data

The latter two tunables controls whether metadata and/or user data
when doing extreme rewind.

Make 'zpool import -T' imply scrub.

Make zpool import -T <txg> accept hexadecimal values for the txg when
prefixed with 0x.

Skip txg's for which there is no uberblock when doing extreme rewind.

Skip reading all user data twice by skipping prefetches when doing
extreme rewinds as we do not access via the ARC.

Illumos issues:
  4970 need controls on i/o issued by zpool import -XF
  4971 zpool import -T should accept hex values
  4972 zpool import -T implies extreme rewind, and thus a scrub
  4973 spa_load_retry retries the same txg
  4974 spa_load_verify() reads all data twice
2014-07-29 05:49:16 +00:00
delphij
12df8077a6 MFC r268713: MFV r268702:
Add missing *_destroy() calls in various places with ZFS.

Illumos issue:
  4975 missing mutex_destroy() calls in zfs
2014-07-29 05:41:54 +00:00
trasz
24c4578f54 MFC r269088:
Fix ctl(4) kldload failure that manifested like this:

link_elf_obj: symbol icl_pdu_new_bhs undefined

PR:		192031
Submitted by:	Nils Beyer (earlier version)
Sponsored by:	FreeBSD Foundation
2014-07-28 22:25:27 +00:00
jfv
00e682104e MFC of R267935: Sync the E1000 shared code to Intel internal, and
more importantly add new I218 adapter support to em.
2014-07-28 21:11:18 +00:00
marcel
37a9f7be2f MFC r268236,268264,268524,268646,268802,269021:
This brings VHD support to mkimg(1); both dynamic and fixed file formats.
Dynamic VHD and VMDK file images are now sparsely written, meaning that
"free" sectors do not occupy space.

Relnotes: yes
2014-07-28 02:07:16 +00:00
kib
920342975e MFC r268766:
Do not ignore error from tmpfs_alloc_vp().
2014-07-28 01:25:49 +00:00
kib
12dac89c4e MFC r268617:
Rework the tmpfs unmount.
2014-07-28 01:23:59 +00:00
kib
20a6651181 MFC r268615:
Add OBJ_TMPFS_NODE flag.

MFC r268616:
Set the OBJ_TMPFS_NODE flag for vm_object of VREG tmpfs node.

MFC r269053:
Correct assertion. tmpfs vm object is always at the bottom of
the shadow chain.
2014-07-28 01:21:02 +00:00
kib
d2764792a7 MFC r268614:
Use tmpfs_vn_get_ino_gen() to handle the races with reclaim in tmpfs
dotdot lookup.
2014-07-28 01:16:07 +00:00
kib
86ba2f30ea MFC r268613:
Style.  Add comment about lock mode.
2014-07-28 01:14:25 +00:00
kib
36fc0d1d01 MFC r268612:
Add helper helper vfs_write_suspend_umnt().

Fix the bug in the FFS unmount, when suspension failed, the ufs
extattrs were not reinitialized.
2014-07-28 01:11:29 +00:00
kib
2ac333b7af MFC r268611:
Replace goto's with the return.
2014-07-28 01:08:43 +00:00
kib
eb32c3f0ff MFC r268610:
Add convenience macro to assert tmpfs node lock.
2014-07-28 01:06:36 +00:00
kib
8c4ee72725 MFC r268609:
Add some assertions for the code handling vm_object for tmpfs vnode.
2014-07-28 01:04:33 +00:00
kib
1a878ba1c0 MFC r268608:
The tmpfs_link() must not dereference the filesystem-specific data for
a vnode until it is verified that the vnode indeed belongs to tmpfs mount.
2014-07-28 01:01:20 +00:00
kib
e0e54a97de MFC r268607:
In kern_linkat(), avoid passing doomed vnode to the VOP.
2014-07-28 00:57:28 +00:00
kib
49b4c6d03e MFC r268606:
Generalize vn_get_ino() to allow filesystems to use custom vnode
producer. Convert inline copies of vn_get_ino() in msdosfs and cd9660
into the uses of vn_get_ino_gen().
2014-07-28 00:53:26 +00:00
kib
35e4a7c8ff MFC r268605:
Remove code separator lines which do not conform to style(9).
2014-07-28 00:43:42 +00:00
kib
979b1ce80a MFC r269081:
Fix typo.
2014-07-27 18:08:47 +00:00
mav
7219c9daf2 MFC r269058:
Fix build with QUEUE_MACRO_DEBUG.
2014-07-27 08:02:24 +00:00
pfg
26a3b70214 MFC r269016:
Fix mismatch.
2014-07-26 02:41:18 +00:00
ian
3a58a39d52 MFC r268401, r268495:
Pending interrupt status is cleared by writing to the ISR, not the data reg.

  Use named constant rather than '0' to access the reset controller register.
2014-07-25 23:36:39 +00:00