Commit Graph

194517 Commits

Author SHA1 Message Date
dteske
a35804263c MFC r259054:
Performance and debugging enhancements:
+ Remove UNAME_P=$(...) from startup/misc -- already supplied by common.subr
+ Use f_getvar instead of $(eval echo \$$var) -- f_getvar is sub-shell free
+ Add `-e' and `-k var' options to f_eval_catch -- increasing use-cases
+ Use f_eval_catch to display errors on failure -- reducing duplicated code
+ Use f_eval_catch when we need output from a command -- improving debugging
+ Optimize f_isinter of strings.subr for performance -- now sub-shell free
+ Improve error checking on pidfiles -- using f_eval_catch and f_isinteger
+ Use $var_to_set arg of f_ifconfig_{inet,netmask} -- eliminate sub-shells
+ Use f_sprintf instead of $(printf ...) -- consolidate sub-shells
+ Use $var_to_set arg of f_route_get_default -- eliminate sub-shells
+ Add f_count to replace $(set -- ...;echo $#) -- eliminate sub-shells
+ Add f_count_ifs to replace $(IFS=x;set -- ...;echo $#) -- no sub-shells
+ Replace var="$var${var:+ }..." in loops with var="$var ..." with a follow-
  up var="${var# }" to trim leading whitespace -- optimize loops
+ Use $var_to_set arg of f_resolv_conf_nameservers -- eliminate sub-shells
+ Comments for the f_eval_catch function
+ Remove a duplicate `local ... desc ...' in f_device_get_all of device.subr
+ Use $var_to_set arg of f_device_capacity -- eliminate sub-shells
+ Whitespace fixes in f_dialog_init of dialog.subr
+ Optimize f_inet_atoi of media/tcpip.subr for performance -- sub-shell free
+ In several cases, send stderr to /dev/null -- clean up runtime execution
+ Change f_err of common.subr to go to program stderr not terminal stderr,
  allowing redirection of output from functions that use f_err
+ Disable debugging when using f_getvar to get variable argument to
  f_startup_rcconf_map_expand of startup/rcconf.subr
+ Use f_replace_all instead of $(echo ... | tr | sed) -- performance
+ Add a $var_to_set option to f_index_{file,menusel_{command,keyword}} of
  common.subr -- centralize sub-shells
2014-01-15 07:49:17 +00:00
dteske
44abef9537 MFC r258458:
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').
2014-01-15 07:42:31 +00:00
dteske
a623494f5e MFC r258355,258360,258400-258401,258406-258407,258418,258430,258439,258589-
258590,258592,258727-258728,258785, with the following descriptions:

Revisions 258400-258401,258406-258407,258590,258727-258728,258785:
+ Add a new `includes' module (see: bsdconfig includes -h) for exploring
  the bsdconfig(8) API

Remaining revisions:
258592: Sort all the messages.subr files
258355: Fix typo in a comment in networking/device.subr
258360: Whitespace, style, and other changes in networking/device.subr
258418: Quote interface names for good measure in networking/device.subr
258430: Remove an unused line in networking/device.subr
258439: Minor bugfix to f_die() function in common.subr
258589: Minor bugfix to syscons_ttys module
2014-01-15 07:36:34 +00:00
jhibbits
0920d1cd65 MFC r259284,r259287
Add PMU-based CPU frequency scalling.  This is used on most Titanium
PowerBooks.
2014-01-15 06:17:15 +00:00
jhibbits
876be05179 MFC r259082
Make some unsigned ints signed.

Found by:	clang (powerpc64)
2014-01-15 05:52:06 +00:00
jhibbits
18daeaf646 MFC r257941,r258119
Add the necessary bits for dumps on ppc64.
2014-01-15 05:41:28 +00:00
jhibbits
04f97f6231 MFC r258362
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.
2014-01-15 05:30:05 +00:00
jhibbits
b1391adbae MFC r256543,r259245,r259421,r259668,r259674
r256543:

Add fasttrap for PowerPC.  This is the last piece of the DTrace/ppc puzzle.
It's incomplete, it doesn't contain full instruction emulation, but it should be
sufficient for most cases.

r259245,r259421: (FBT)

FBT now does work fully on PowerPC.

Save r3 before using it for the trap check, else we end up saving the new r3,
containing the trap instruction encoding (0x7c810808), and restoring it back
with the frame on return.  This caused it to panic on my ppc32 machine.

r259668,r259674:
Fix a typo in the FBT code.
2014-01-15 05:19:37 +00:00
jhibbits
44cab258a2 MFC r259394,r259395,r259699
r259394:
Rebase the PMC indices at 1, since PMC_SOFT is at 0.

r259395,r259699:
Add userland PMC backtracing, and use the PMC trapframe macros for kernel
backtraces.
2014-01-15 04:44:52 +00:00
jhibbits
541949d319 MFC r256542,r256581
Move the PMC handling to the first level interrupt handler where it belongs.
Also add the pmc_hook use, to handle callchain tracing.
2014-01-15 04:16:45 +00:00
hrs
95bb8ad4b6 Remove a non-applicable sentence. 2014-01-15 00:12:19 +00:00
hrs
21f388f6a6 Fix release numbers and branch names. 2014-01-15 00:11:09 +00:00
hrs
24a7dad85e - MFC 260653,260655:
* Purge old translations.
* Add missing footer due to DSSSL->XSLT migration and use XML catalog to
  resolve URI.
* Add missing arch= and revision= support.

- Update release.ent and fix release number in Errata.
2014-01-14 23:15:53 +00:00
delphij
c152bbe479 MFC r260637:
Disable 'monitor' feature in ntpd by default.

Security:	FreeBSD-SA-14:02.ntpd
Approved by:	so
2014-01-14 19:04:33 +00:00
delphij
defa475beb MFC r260636:
Fix bsnmpd remote denial of service vulnerability.

Reported by:	dinoex
Submitted by:	harti
Security:	FreeBSD-SA-14:01.bsnmpd
Security:	CVE-2014-1452
2014-01-14 19:02:14 +00:00
pfg
b405aa87ad MFC r260545:
ext2fs: fix inode flag conversion.

After r252890 we are naively attempting to pass through the
inode flags.  This is technically incorrect as the ext2
inode flags don't match the UFS/system values used in
FreeBSD and a clean conversion is needed.

Some filtering was left in place so the change didn't cause
significant changes in FreeBSD but some of the garbage passed
is likely to be the cause for warning messages in linux.

Fix the issue by resetting the flags before conversion as was
done previously. This also means we will not pass the EXT4_*
inode flags into FreeBSD's inode.

PR:		kern/185448
2014-01-14 15:20:33 +00:00
pluknet
5889b488e3 MFC r257705:
Clean up -Wtautological-compare -Wformat warnings.
2014-01-14 14:03:28 +00:00
mav
204096a62c MFC r260541, r260547:
Take additional reference on SCSI probe periph to cover its freeze count.

Otherwise periph may be invalidated and freed before single-stepping freeze
is dropped, causing use after free panic.
2014-01-14 12:01:36 +00:00
pluknet
a7224392fd MFC r259921,259950:
Provide the manual page for aio_fsync(2).
2014-01-14 09:49:42 +00:00
delphij
139f0a076d MFC r259811:
MFV r258373:

4168 ztest assertion failure in dbuf_undirty

4169 verbatim import causes zdb to segfa
4170 zhack leaves pool in ACTIVE state

illumos/illumos-gate@7fdd916c47
2014-01-14 01:28:08 +00:00
bdrewery
f8756761dd MFC r260605:
Remove scary comment about this being a test key.

  There has been no need to regenerate the signing key.

Early MFC as it is just a comment and needs to get into releng/10.0.

Approved by:	bapt (mentor, implicit)
2014-01-13 22:07:36 +00:00
delphij
d17709df94 MFC r260110:
Eliminate unused drbr_stats_update implementation in oce(4) driver.

Noticed by:	dim
2014-01-13 19:34:23 +00:00
jilles
9033033601 MFC r260336,r260355: find: Fix -lname and -ilname:
* Take into account that readlink() does not add a terminating '\0'.

* Do not match symlinks that are followed because of -H or -L. This is
  explicitly documented in GNU find's info file and is like -type l.

* Fix matching symlinks in subdirectories when fts changes directories.

As before, symlinks of length PATH_MAX or more are not handled correctly.
(These can only be created on other operating systems.)

Also, avoid some readlink() calls on files that are obviously not symlinks
(because of fts(3) restrictions, not all of them).

PR:		bin/185393
Submitted by:	Ben Reser (parts, original version)
2014-01-12 23:17:56 +00:00
jmmv
97eeccbbec MFC r260491: Use .cpp as the extension for temporary C++ files. 2014-01-12 22:17:56 +00:00
pfg
f630f6f40f MFC r260310:
libcpp: misc fixes from Apple's GCC.

Fixes some bugs detected by Apple:
  #error with unmatched quotes
  pragma mark

Obtained from:	Apple GCC 4.2 - 5553
2014-01-12 21:16:26 +00:00
pfg
d54137712a MFC r259920:
gcc: Implement -Wmost for compatibility with clang.

This is equivalent to -Wall -Wno-parentheses.

Obtained from:	Apple GCC 4.2 - 5531
2014-01-12 20:09:17 +00:00
dim
efe1ed4163 MFC r260494:
Fix a braino with r259730: we cannot currently use CFLAGS.gcc or
CFLAGS.clang in sys/conf/Makefile.arm, since the main kernel build does
not use <bsd.sys.mk>.  So revert that particular change for now.

Pointy hat to:	me
Noticed by:	zbb
2014-01-12 14:37:39 +00:00
remko
dfee5da730 MFC r260446
virtio-block does not exist, the correct name is virtio-blk.

  PR:	    185573
  Submitted by:    Allan Jude
  Facilitated by: Snow B.V.
2014-01-11 23:10:59 +00:00
hselasky
2d29b474fb MFC r260184:
Minor correction for the XHCI reset logic.
2014-01-11 08:21:13 +00:00
pfg
f5cc643aac MFC r260361:
gcc: Fix optimization bug.

GCC-PR rtl-optimization/34628
	* combine.c (try_combine): Stop and undo after the first combination
	if an autoincrement side-effect on the first insn has effectively
	been lost.
2014-01-11 01:44:22 +00:00
asomers
6b686ee50a MFC 259339
sbin/devd/devd.cc
        Increase the size of devd's client socket's send buffer from the
        default (8k) to 128k.  This prevents clients from getting
        POLLHUPped during event storms.  For example, during zpool creation,
        the kernel emits a resource.fs.zfs.statechange event for every vdev
        in the pool.  A 128k buffer is large enough to hold the statechange
        events for a pool with nearly 800 drives.

MFC 259362
    sbin/devd/devd.cc
        Promoting the SIGINFO handler's log message from LOG_INFO to
        LOG_NOTICE, and promoting the "Processing event ..." message from
        LOG_DEBUG to LOG_INFO.  Setting the logfile to LOG_NOTICE with this
        change will have the same result as setting it to LOG_INFO without
        this change.  Setting it to LOG_INFO with this change will include
        the useful "Processing event ..." messages that were previously at
        LOG_DEBUG, without including useless messages like "Pushing table".

        The intent of this change is that one can log "Processing event ..."
        without logging "Pushing table" and related messages that are sent
        for every event.  The number of lines actually logged is reduced by
        about 75% by making this change and setting syslog to LOG_INFO vs
        setting syslog to LOG_DEBUG.

    etc/syslog.conf
        Changing the recommended loglevel to notice instead of info.
2014-01-10 17:56:23 +00:00
asomers
d1a85fc0d9 MFC 259240
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
        When a da or ada device dissappears, outstanding IOs fail with
        ENXIO, not EIO.  The check for EIO was probably copied from Illumos,
        where that is indeed the correct errno.

        Without this change, pulling a busy drive from a zpool would usually
        turn it into UNAVAIL, even though pulling an idle drive would turn
        it into REMOVED.  With this change, it is REMOVED every time.

        Also, vdev_geom_io_intr shouldn't do zfs_post_remove, because that
        results in devd getting two resource.fs.zfs.removed events.  The
        comment said that the event had to be sent directly instead of
        through the async removal thread because "the DE engine is using
        this information to discard prevoius I/O errors".  However, the fact
        that vdev_geom_io_intr was never actually sending the events until
        now, and that vdev_geom_orphan never sent them at all, and that
        vdev_geom_orphan usually gets called about 2 seconds after the
        actual removal, means that FreeBSD's userland can cope with a late
        event just fine.
2014-01-10 16:56:59 +00:00
ae
65169ca8a0 MFC r260151 (by adrian):
Use an RLOCK here instead of an RWLOCK - matching all the other calls
  to lla_lookup().

  This drastically reduces the very high lock contention when doing parallel
  TCP throughput tests (> 1024 sockets) with IPv6.

MFC r260187:
  lla_lookup() does modification only when LLE_CREATE is specified.
  Thus we can use IF_AFDATA_RLOCK() instead of IF_AFDATA_LOCK() when doing
  lla_lookup() without LLE_CREATE flag.

MFC r260217:
  Add IF_AFDATA_WLOCK_ASSERT() in case lla_lookup() is called with
  LLE_CREATE flag.
2014-01-10 09:45:28 +00:00
ae
2865f87f4a MFC r259634:
Prevent users from deactivating the last component of a mirror.

MFC r259929:
  Add an ability to stop gmirror and clear its metadata in one command.
  This fixes the problem, when gmirror starts again just after stop.

  The problem occurs when gmirror's component has geom label with equal size.
  E.g. gpt and gptid have the same size as partition, diskid has the same
  size as entire disk. When gmirror's geom has been destroyed, glabel
  creates its providers and this initiate retaste.

  Now "gmirror destroy" command is available. It destroys geom and also
  erases gmirror's metadata.

PR:		184985
2014-01-10 07:48:36 +00:00
ae
5308ec5802 MFC r258357:
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.
2014-01-10 07:43:40 +00:00
wblock
a956d3e4f7 MFC r260358
Fix a cut and paste error.
2014-01-09 23:51:47 +00:00
dim
01c13c7d48 MFC r260334:
Split the last gcc-specific flags off into CFLAGS.gcc.  This also
removes the need to use -Qunused-arguments for clang throughout the
tree.

MFC r260369:

Apply band-aid for 32-bit compat libs failures after r260334: put back
-Qunused-arguments for clang for now, until I can figure out a way to
make it unneeded in all scenarios.  Sorry about the breakage.
2014-01-09 23:08:56 +00:00
dim
999774a8ef MFC r260102:
Similar to r260020, only use -fms-extensions with gcc, for all other
modules which require this flag to compile.  Use a GCC_MS_EXTENSIONS
variable, defined in kern.pre.mk, which can be used to easily supply the
flag (or not), depending on the compiler type.

MFC r260322:

In addition to r260102, also define GCC_MS_EXTENSIONS in bsd.sys.mk,
since kernel module builds do not use kern.pre.mk.
2014-01-09 22:40:51 +00:00
loos
837513035e MFC r257064:
Add an OFW SPI compatible bus.  Fix the spibus probe to return
BUS_PROBE_GENERIC and not BUS_PROBE_SPECIFIC (0) so the OFW SPI bus can
attach when enabled.  Export the spibus devclass_t and driver_t
declarations.

Submitted by:	ray
Approved by:	adrian (mentor)
2014-01-09 18:28:58 +00:00
mav
263d261fe5 MFC r258683:
Escape special XML chars, returned by some devices, confusing XML parsers.
2014-01-09 11:13:03 +00:00
mav
3b6d8c3206 MFC r258220, r258251:
Implement automatic live resize support for GEOM MULTIPATH class.

In "manual" mode just automatically resize provider in any direction.
In "automatic" mode allow growth (with new metadata write); in case of
shrinking check if there is already valid metadata found at the new
location.  This should allow easy transparent recovery if first resize
was done by mistake.

While there, unify metadata write code and fix minor memory leak.
2014-01-09 11:11:47 +00:00
mav
f9a52747b5 MFC r257946:
Introduce seperate mutex lock to protect protect CTL I/O pools, slightly
reducing global CTL lock scope and congestion.

While there, simplify CTL I/O pools KPI, hiding implementation details.
2014-01-09 10:59:31 +00:00
mav
2886802896 MFC r256995:
Remove 128KB bzero() call done for every block I/O data buffer.
2014-01-09 10:50:20 +00:00
mav
2e2af5808b MFC r256547 (by smh):
Added 4K quirks for Corsair Neutron GTX SSD's
2014-01-09 10:49:14 +00:00
mav
211b1cf423 MFC r259197:
Do not DELAY() for P-state transition unless we want to see the result.

Intel manual says: "If a transition is already in progress, transition to
a new value will subsequently take effect. Reads of IA32_PERF_CTL determine
the last targeted operating point."  So seems it should be fine to just
trigger wanted transition and go.  Linux does the same.
2014-01-09 10:44:27 +00:00
kib
dd0e0d7345 MFC r260205:
Update the description for pmap_remove_pages() to match the modern
times.  Assert that the pmap passed to pmap_remove_pages() is only
active on current CPU.
2014-01-09 03:32:03 +00:00
kib
a3d28139be MFC r260204:
Assert that accounting for the pmap resident pages does not underflow.
2014-01-09 03:24:36 +00:00
pfg
e22a9135f1 MFC r259873:
gcc: small enhancements for the arm support.

fixes GCC-PR target/31152

Obtained from:	gcc 4.3 (rev. r118461, 125973: GPLv2)
2014-01-08 19:33:16 +00:00
peter
aa3916c7c0 Revert MFC of r258821 - it was already handled by MFC of r239672.
Pointy hat to: peter
2014-01-08 03:16:21 +00:00
cperciva
5190528326 MFC r258893, r258956:
Add a new sysctl / loader tunable kern.panic_reboot_wait_time which
  defaults to PANIC_REBOOT_WAIT_TIME (a long-existing kernel config
  setting).  Use this now-variable value in place of the defined constant
  to control how long the system waits after a panic before rebooting.
2014-01-08 02:19:39 +00:00