8 years agosh: Add UTF-8 support to ${#var}.
Peter Avalos [Sun, 3 Jul 2011 02:31:33 +0000 (16:31 -1000)]
sh: Add UTF-8 support to ${#var}.

If the current locale uses UTF-8, ${#var} counts codepoints (more
precisely, bytes b with (b & 0xc0) != 0x80).

Obtained-from:   FreeBSD SVN rev 221602

8 years agosh: Track if the current locale's charset is UTF-8 or not.
Peter Avalos [Sun, 3 Jul 2011 02:28:16 +0000 (16:28 -1000)]
sh: Track if the current locale's charset is UTF-8 or not.

Obtained-from:   FreeBSD SVN rev 221559

8 years agosh: Change the CTL* bytes to ones invalid in UTF-8.
Peter Avalos [Sun, 3 Jul 2011 02:15:36 +0000 (16:15 -1000)]
sh: Change the CTL* bytes to ones invalid in UTF-8.

This ensures that mbrtowc(3) can be used directly once it has been
verified that there is no CTL* byte. Dealing with a CTLESC byte
within a multibyte character would be complicated.

Obtained-from:   FreeBSD SVN rev 221551

8 years agosh: Add $'quoting' (C-style escape sequences).
Peter Avalos [Sun, 3 Jul 2011 00:29:49 +0000 (14:29 -1000)]
sh: Add $'quoting' (C-style escape sequences).

A string between $' and ' may contain backslash escape sequences similar
to the ones in a C string constant (except that a single-quote must be
escaped and a double-quote need not be). Details are in the sh(1) man

This construct is useful to include unprintable characters, tabs and
newlines in strings; while this can be done with a command substitution
containing a printf command, that needs ugly workarounds if the result
is to end with a newline as command substitution removes all trailing

The construct may also be useful in future to describe unprintable
characters without needing to write those characters themselves in 'set
-x', 'export -p' and the like.

The implementation attempts to comply to the proposal for the next issue
of the POSIX specification. Because this construct is not in
POSIX.1-2008, using it in scripts intended to be portable is unwise.

Matching the minimal locale support in the rest of sh, the \u and \U
sequences are currently not useful.

Obtained-from:   FreeBSD SVN rev 221513

8 years agosh: Apply set -u to variables in arithmetic.
Peter Avalos [Sun, 3 Jul 2011 00:07:08 +0000 (14:07 -1000)]
sh: Apply set -u to variables in arithmetic.

Note that this only applies to variables that are actually used.
Things like (0 && unsetvar) do not cause an error.

Obtained-from:   FreeBSD SVN rev 221463

8 years agosh: Detect an error for ${#var<GARBAGE>}.
Peter Avalos [Sun, 3 Jul 2011 00:03:42 +0000 (14:03 -1000)]
sh: Detect an error for ${#var<GARBAGE>}.

In particular, this makes things like ${#foo[0]} and ${#foo[@]} errors
rather than silent equivalents of ${#foo}.

Obtained-from:   FreeBSD SVN rev 221461

8 years agosh: Set $? to 0 for background commands.
Peter Avalos [Sat, 2 Jul 2011 23:59:09 +0000 (13:59 -1000)]
sh: Set $? to 0 for background commands.

For backgrounded pipelines and subshells, the previous value of $? was
being preserved, which is incorrect.

For backgrounded simple commands containing a command substitution, the
status of the last command substitution was returned instead of 0.

If fork() fails, this is an error.

Obtained-from:   FreeBSD SVN rev 221027

8 years agosh: Remove duplicate code resetting uid/gid for set +p/+o privileged.
Peter Avalos [Sat, 2 Jul 2011 23:47:49 +0000 (13:47 -1000)]
sh: Remove duplicate code resetting uid/gid for set +p/+o privileged.

sh: Check setuid()/setgid() return values.

If the -p option is turned off, privileges from a setuid or setgid
binary are dropped. Make sure to check if this succeeds. If it
fails, this is an error which will cause the shell to abort except
in interactive mode or if 'command' was used to make 'set' or an
outer 'eval' or '.' non-special.

Obtained-from:   FreeBSD SVN rev 221011 & 221012

8 years agosh: Allow EV_EXIT through function calls.
Peter Avalos [Sat, 2 Jul 2011 23:38:15 +0000 (13:38 -1000)]
sh: Allow EV_EXIT through function calls.

make {...} <redir more consistent.

If EV_EXIT causes an exit, use the exception mechanism to unwind
redirections and local variables. This way, if the final command is a
redirected command, an EXIT trap now executes without the redirections.

Because of these changes, EV_EXIT can now be inherited by the body of a
function, so do so. This means that a function no longer prevents a fork
before an exec being skipped, such as in
  f() { head -1 /etc/passwd; }; echo $(f)

Wrapping a single builtin in a function may still cause an otherwise
unnecessary fork with command substitution, however.

An exit command or -e failure still invokes the EXIT trap with the
original redirections and local variables in place.

Note: this depends on SHELLPROC being gone. A SHELLPROC depended on
keeping the redirections and local variables and only cleaning up the
state to restore them.

Obtained-from:   FreeBSD SVN rev 220978

8 years agosh: Do not word split "${#parameter}".
Peter Avalos [Sat, 2 Jul 2011 23:28:01 +0000 (13:28 -1000)]
sh: Do not word split "${#parameter}".

This is only a problem if IFS contains digits, which is unusual but

Obtained-from:   FreeBSD SVN rev 221522

8 years agohptiop(4): Sync with FreeBSD (adds IDs for two more cards).
Sascha Wildner [Sun, 21 Aug 2011 17:45:09 +0000 (19:45 +0200)]
hptiop(4): Sync with FreeBSD (adds IDs for two more cards).

8 years agointr/i386: Define IDT_HWI_VECTORS
Sepherosa Ziehau [Sun, 21 Aug 2011 13:02:48 +0000 (21:02 +0800)]
intr/i386: Define IDT_HWI_VECTORS

This macro defines how many IDT vectors that could be setup as hardware
interrupts.  Use this macro instead of MAX_HARDINTS and APIC_INTMAPSIZE.

8 years agoicu/i386: Remove unnecessary header inclusion
Sepherosa Ziehau [Sun, 21 Aug 2011 11:33:54 +0000 (19:33 +0800)]
icu/i386: Remove unnecessary header inclusion

8 years agoadd more information to a failing assertion's panic message
Adam Hoka [Thu, 11 Aug 2011 16:52:59 +0000 (18:52 +0200)]
add more information to a failing assertion's panic message

Signed-off-by: Venkatesh Srinivas <me@endeavour.zapto.org>
8 years agokernel - Fix vm_object leak which could exhaust swap space
Matthew Dillon [Sat, 20 Aug 2011 20:38:42 +0000 (13:38 -0700)]
kernel - Fix vm_object leak which could exhaust swap space

* Fix a recently introduced vm_object leak.  When deallocating a vm_object
  ref_count must be decremented prior to calling vm_object_collapse() or
  we can wind up leaving an object sitting around with 0 refs on it.

Reported-by: ftigeot, others
8 years agotcp: Enable tcp_lport_extension by default
Sepherosa Ziehau [Fri, 19 Aug 2011 02:42:17 +0000 (10:42 +0800)]
tcp: Enable tcp_lport_extension by default

8 years agoinpcb: Don't choose lport which could render same addr/port pair
Sepherosa Ziehau [Fri, 19 Aug 2011 02:05:47 +0000 (10:05 +0800)]
inpcb: Don't choose lport which could render same addr/port pair

A TCP connect to could be successful even if there is
no process listening on PORT_A: <--->

The problem here is that PORT_A is chosen as the lport for the socket
to be connected to PORT_A, and this actually creates simultaneous connect
on but with only one inpcb.  Socket connected in this way is
useless and could break connect retry for the service listens on the
loopback interface.  Therefore, we skip the lport if the result will be:
(lport == fport && laddr == faddr)

NOTE: This still does not guard against explicit local port and address
chosen using bind(2) and then calling connect(2)

8 years agobrgphy: Recognize more Broadcom PHYs
Sepherosa Ziehau [Thu, 18 Aug 2011 13:44:03 +0000 (21:44 +0800)]
brgphy: Recognize more Broadcom PHYs

Obtained-from: OpenBSD, FreeBSD

8 years agomiidevs.h: regen
Sepherosa Ziehau [Thu, 18 Aug 2011 13:43:37 +0000 (21:43 +0800)]
miidevs.h: regen

8 years agomiidevs: Add more Broadcom PHY IDs
Sepherosa Ziehau [Thu, 18 Aug 2011 13:42:55 +0000 (21:42 +0800)]
miidevs: Add more Broadcom PHY IDs

Obtained-from: OpenBSD, FreeBSD

8 years agokernel: Fix alignment problem for sendmsg ancillary message data.
Venkatesh Srinivas [Wed, 17 Aug 2011 17:22:56 +0000 (10:22 -0700)]
kernel: Fix alignment problem for sendmsg ancillary message data.

Closes bug 2116; sending file descriptors is broken on amd64.

From: Darwin xnu-123.5, NetBSD socket.h 1.50

8 years agoinstaller: Tone down the comments around the installer's rc.conf settings.
Sascha Wildner [Tue, 16 Aug 2011 15:57:32 +0000 (17:57 +0200)]
installer: Tone down the comments around the installer's rc.conf settings.

dumpdev is the only thing that is written by default and it tended to
get lost among the rather verbose comments.

8 years agoLINT/LINT64: Add KTR_TSLEEP.
Sascha Wildner [Tue, 16 Aug 2011 14:18:44 +0000 (16:18 +0200)]

8 years agobrgphy: Bring in changes from OpenBSD
Sepherosa Ziehau [Tue, 16 Aug 2011 09:45:30 +0000 (17:45 +0800)]
brgphy: Bring in changes from OpenBSD

- Link status is now detected using BMSR
- Extra link status detection based on AUXSTS is used for 5906
- Shuffle 5906 EPHY setting around
- brgphy_loop() is not necessary to start auto-negotiation

8 years agoFix crossbuilding x86_64 on i386.
Sascha Wildner [Tue, 16 Aug 2011 07:40:02 +0000 (09:40 +0200)]
Fix crossbuilding x86_64 on i386.

Brings back two things from cdefb602 and a262c465.

8 years agomsk(4): Add support for Yukon Supreme
Sepherosa Ziehau [Mon, 15 Aug 2011 11:31:06 +0000 (19:31 +0800)]
msk(4): Add support for Yukon Supreme

Obtained-from: FreeBSD 222230

8 years agomsk(4): Disable ASF on the chips that have it
Sepherosa Ziehau [Mon, 15 Aug 2011 11:23:14 +0000 (19:23 +0800)]
msk(4): Disable ASF on the chips that have it

Obtained-from: FreeBSD 222227

8 years agomsk(4): Make sure to enable all clocks before accessing registers.
Sepherosa Ziehau [Mon, 15 Aug 2011 11:17:49 +0000 (19:17 +0800)]
msk(4): Make sure to enable all clocks before accessing registers.

Obtained-from: FreeBSD 222226

8 years agoVFS_START() uses only two arguments
François Tigeot [Mon, 15 Aug 2011 05:35:12 +0000 (07:35 +0200)]
VFS_START() uses only two arguments

8 years agoFix crossbuilding i386 on x86_64.
Sascha Wildner [Sun, 14 Aug 2011 22:21:18 +0000 (00:21 +0200)]
Fix crossbuilding i386 on x86_64.

bfd_elf64_archive_slurp_armap() is needed for building an i386
libbfd on x86_64.

8 years agomsk(4): Only Yukon FE, XL and EC have RAM registers
Sepherosa Ziehau [Sun, 14 Aug 2011 14:08:37 +0000 (22:08 +0800)]
msk(4): Only Yukon FE, XL and EC have RAM registers

Obtained-from: FreeBSD 222223

8 years agomsk(4): Enable store and forward mode except for jumbo frame on Yukon Ultra.
Sepherosa Ziehau [Sun, 14 Aug 2011 12:52:35 +0000 (20:52 +0800)]
msk(4): Enable store and forward mode except for jumbo frame on Yukon Ultra.

Obtained-from: 222221

8 years agomsk(4): Do not blindly clear entire GPHY control register.
Sepherosa Ziehau [Sun, 14 Aug 2011 12:39:58 +0000 (20:39 +0800)]
msk(4): Do not blindly clear entire GPHY control register.

It seems some bits of the register is used for other purposes such
that clearing these bits resulted in unexpected results such as
corrupted RX frames or missing LE status updates.

Obtained-from: FreeBSD 222219

8 years agomsk(4): Don't process incoming packets if the interface is down
Sepherosa Ziehau [Sun, 14 Aug 2011 12:34:31 +0000 (20:34 +0800)]
msk(4): Don't process incoming packets if the interface is down

Obtained-from: FreeBSD 207623

8 years agomsk(4): Don't unnecessarily clear interrupt masks
Sepherosa Ziehau [Sun, 14 Aug 2011 12:29:52 +0000 (20:29 +0800)]
msk(4): Don't unnecessarily clear interrupt masks

Obtained-from: FreeBSD 207623

8 years agomdoc.local: We must indent using spaces here.
Sascha Wildner [Sat, 13 Aug 2011 20:34:22 +0000 (22:34 +0200)]
mdoc.local: We must indent using spaces here.

8 years agoSynchronize the description of struct statfs with its real
François Tigeot [Sat, 13 Aug 2011 16:25:57 +0000 (18:25 +0200)]
Synchronize the description of struct statfs with its real
definition on DragonFly 2.11

8 years agoktr(4): Allow to configure KTR_TSLEEP alone.
Sascha Wildner [Sat, 13 Aug 2011 16:03:09 +0000 (18:03 +0200)]
ktr(4): Allow to configure KTR_TSLEEP alone.

8 years agoMerge branch 'vendor/AWK'
Sascha Wildner [Fri, 12 Aug 2011 21:08:08 +0000 (23:08 +0200)]
Merge branch 'vendor/AWK'

8 years agoImport awk-20110810.
Sascha Wildner [Fri, 12 Aug 2011 21:07:23 +0000 (23:07 +0200)]
Import awk-20110810.

* /pat/, \n /pat/ {...} is now legal, though bad style to use.
* added checks to new -v code that permits -vnospace
* removed fixed limit on number of open files
* fixed day 1 bug that resurrected deleted elements of ARGV when
  used as filenames (in lib.c).
* minor type fiddles to make gcc -Wall -pedantic happier (but not
  totally so)
* split(s, a, //) now behaves the same as split(s, a, "")
* another fix to avoid core dump with delete(ARGV)

8 years agokernel/x86_64: Remove bogus and unused file.
Sascha Wildner [Fri, 12 Aug 2011 02:43:38 +0000 (04:43 +0200)]
kernel/x86_64: Remove bogus and unused file.

8 years agokernel - Fix deadlock w/recent vm_map work
Matthew Dillon [Thu, 11 Aug 2011 21:38:09 +0000 (14:38 -0700)]
kernel - Fix deadlock w/recent vm_map work

* Fix a deadlock where a vm_page is being held PG_BUSY throgh a vm_map
  relocking operation.  This can deadlock against the attempt to busy
  a vm_page while holding a vm_map lock.

* The solution is a bit of a hack.  Currently allow the relock attempt to
  timeout and force a retry of the VM fault, which unlocks and relocks
  everything.  This is not the best solution but the problem occurs
  fairly rarely so for now it should be an acceptable workaround.

Reported-by: ftigeot, Studbolt
8 years agomfi(4): Merge LSI's latest driver changes (updates us to version 3.981).
Sascha Wildner [Thu, 11 Aug 2011 18:31:01 +0000 (20:31 +0200)]
mfi(4): Merge LSI's latest driver changes (updates us to version 3.981).

This adds support for a number of cards (according to LSI's README):

* LSI MegaRAID SAS 9240-4i
* LSI MegaRAID SAS 9240-8i
* LSI MegaRAID SAS 9260-4i
* LSI MegaRAID SAS 9260-8i
* LSI MegaRAID SAS 9260DE-8i
* LSI MegaRAID SAS 9260-16i
* LSI MegaRAID SAS 9261-8i
* LSI MegaRAID SAS 9280-4i4e
* LSI MegaRAID SAS 9280-8e
* LSI MegaRAID SAS 9280DE-8e
* LSI MegaRAID SAS 9280-16i4e
* LSI MegaRAID SAS 9280-24i4e

It was tested by Tomi Juvonen <tomi.juvonen@kenou.biz> on an
IBM ServeRAID M1015 controller using LSI's 9240-8i IR firmware.

8 years agocondvar.9: Mention that cv_broadcastpri()'s pri parameter is discarded.
Sascha Wildner [Thu, 11 Aug 2011 18:28:48 +0000 (20:28 +0200)]
condvar.9: Mention that cv_broadcastpri()'s pri parameter is discarded.

8 years ago<sys/condvar.h>: The cv_broadcastpri() macro needs to take a pri argument.
Sascha Wildner [Thu, 11 Aug 2011 18:28:25 +0000 (20:28 +0200)]
<sys/condvar.h>: The cv_broadcastpri() macro needs to take a pri argument.

8 years agoMark the arcmsr driver MPSAFE
François Tigeot [Thu, 11 Aug 2011 16:13:11 +0000 (18:13 +0200)]
Mark the arcmsr driver MPSAFE

8 years agoImplement a new vfs function, vfs_account()
François Tigeot [Sat, 6 Aug 2011 15:29:06 +0000 (17:29 +0200)]
Implement a new vfs function, vfs_account()

It will be used to implement user and group disk space accounting
with possible filesystem-specific integration

8 years agoacpi(4): Remove bogus line from the Makefile.
Sascha Wildner [Wed, 10 Aug 2011 19:16:49 +0000 (21:16 +0200)]
acpi(4): Remove bogus line from the Makefile.

8 years agomsk(4): Add support for 88E8059
Sepherosa Ziehau [Wed, 10 Aug 2011 14:33:34 +0000 (22:33 +0800)]
msk(4): Add support for 88E8059

Obtained-from: FreeBSD 207445

8 years agomsk(4): Disable non-ASF packet flushing on Yukon Extreme.
Sepherosa Ziehau [Wed, 10 Aug 2011 11:57:59 +0000 (19:57 +0800)]
msk(4): Disable non-ASF packet flushing on Yukon Extreme.

This prevents Yukon Extreme from generating pause frame storm.

Obtained-from: FreeBSD 207442

8 years agomsk(4): RX_GMF_{LP,UP}_THR are 16bits registers
Sepherosa Ziehau [Wed, 10 Aug 2011 11:49:06 +0000 (19:49 +0800)]
msk(4): RX_GMF_{LP,UP}_THR are 16bits registers

Obtained-from: FreeBSD 207409

8 years agomsk(4): PCI_OUR_REG_* and PCI_CFG_REG_* should be accessed indirectly
Sepherosa Ziehau [Wed, 10 Aug 2011 11:44:30 +0000 (19:44 +0800)]
msk(4): PCI_OUR_REG_* and PCI_CFG_REG_* should be accessed indirectly

Obtained-from: FreeBSD 205161 w/ mod

8 years agomsk(4): Enable flow-control only if link is full-duplex
Sepherosa Ziehau [Wed, 10 Aug 2011 11:30:51 +0000 (19:30 +0800)]
msk(4): Enable flow-control only if link is full-duplex

Obtained-from: FreeBSD 204540

8 years agomsk(4): Don't hardcod register offset to set PCIe max read request size.
Sepherosa Ziehau [Wed, 10 Aug 2011 09:48:31 +0000 (17:48 +0800)]
msk(4): Don't hardcod register offset to set PCIe max read request size.

This should fix 88E8072 support

Obtained-from: FreeBSD 204365

8 years agopci: Add function to get PCIe max read request size
Sepherosa Ziehau [Wed, 10 Aug 2011 09:47:05 +0000 (17:47 +0800)]
pci: Add function to get PCIe max read request size

8 years agomsk(4): Add support for 88E8057
Sepherosa Ziehau [Wed, 10 Aug 2011 09:11:20 +0000 (17:11 +0800)]
msk(4): Add support for 88E8057

Obtained-from: FreeBSD 199012 202827

8 years agomsk(4): Force link state detection, if link is not up.
Sepherosa Ziehau [Wed, 10 Aug 2011 09:02:14 +0000 (17:02 +0800)]
msk(4): Force link state detection, if link is not up.

It seems generation of link state change of e1000phy(4) is not reliable
on some Marvell PHYs, so we force a link state change if the link is
still not up.

Obtained-from: FreeBSD 199413

8 years agovkernel(7) - Describe diskless operation.
Antonio Huete Jimenez [Wed, 10 Aug 2011 09:03:48 +0000 (11:03 +0200)]
vkernel(7) - Describe diskless operation.

- Add a section describing needed tunables for diskless operation.
- Add an example on how to boot it.
- Add VKERNEL64 config file to FILES section.

8 years agokernel: Staticize naccess().
Sascha Wildner [Wed, 10 Aug 2011 08:31:17 +0000 (10:31 +0200)]
kernel: Staticize naccess().

8 years agomfi(4) & mfiutil(8): Sync with FreeBSD
Sascha Wildner [Mon, 1 Aug 2011 18:09:52 +0000 (20:09 +0200)]
mfi(4) & mfiutil(8): Sync with FreeBSD

8 years agovkernel(7) - Permit multiple -e options to pass environment variables
Antonio Huete Jimenez [Tue, 9 Aug 2011 19:34:35 +0000 (21:34 +0200)]
vkernel(7) - Permit multiple -e options to pass environment variables
             to the virtual kernel environment.

* kern_envp is a zero-separated string which ends with two zero chars.
  Now every -e option is added to kern_envp so that when the kenv_init
  parses the static envirorment it can process it properly.

8 years agokernel/x86_64: Convert asm accessing segment descriptors to use 16bit ops.
Sascha Wildner [Tue, 9 Aug 2011 08:38:17 +0000 (10:38 +0200)]
kernel/x86_64: Convert asm accessing segment descriptors to use 16bit ops.

This also fixes -O0 compilation of the x86_64 kernel.

Reported-by: alexh
Taken-from:  FreeBSD

8 years agokernel/i386: Use 16 bit types for functions that access segment descriptors.
Sascha Wildner [Tue, 9 Aug 2011 08:38:14 +0000 (10:38 +0200)]
kernel/i386: Use 16 bit types for functions that access segment descriptors.

This is a followup commit to e96f55de.

Taken-from: FreeBSD

8 years agomk - Add two missing files to the README file
Antonio Huete Jimenez [Sun, 7 Aug 2011 20:22:44 +0000 (22:22 +0200)]
mk - Add two missing files to the README file

8 years agoMove static & inline to the beginnings of declarations.
Sascha Wildner [Sun, 7 Aug 2011 02:41:30 +0000 (04:41 +0200)]
Move static & inline to the beginnings of declarations.

8 years agogetsockopt: Add SO_SNDSPACE
Sepherosa Ziehau [Fri, 5 Aug 2011 05:53:17 +0000 (13:53 +0800)]
getsockopt: Add SO_SNDSPACE

This SOL_SOCKET get-only option is used to get the approximate free space
of send buffer.

8 years agoe1000phy: Add support for more Marvell PHYs
Sepherosa Ziehau [Fri, 5 Aug 2011 02:04:58 +0000 (10:04 +0800)]
e1000phy: Add support for more Marvell PHYs

Obtained-from: FreeBSD @211046 +223688

8 years agomiidevs.h: regen
Sepherosa Ziehau [Fri, 5 Aug 2011 02:04:41 +0000 (10:04 +0800)]
miidevs.h: regen

8 years agomii: Add more PHY ids for Marvell PHY chips
Sepherosa Ziehau [Fri, 5 Aug 2011 02:04:09 +0000 (10:04 +0800)]
mii: Add more PHY ids for Marvell PHY chips

8 years agoRemove forth and other unused bits from the loader.
François Tigeot [Thu, 4 Aug 2011 14:53:47 +0000 (16:53 +0200)]
Remove forth and other unused bits from the loader.

More precisely openfirmware, ia64, powerpc, and sparc64 specific code.

8 years agohammer - Add memory use limit option for dedup runs
Matthew Dillon [Thu, 4 Aug 2011 04:57:48 +0000 (21:57 -0700)]
hammer - Add memory use limit option for dedup runs

* Add '-m memlimit' (default 1G) to limit memory use during a dedup run.
  If the limit is reached hammer will reduce the range of CRCs in the scan
  and will perform multiple passes as needed to dedup the entire filesystem.

* VerboseOpt (-v) will be verbose about crc-range truncation and multiple

8 years agohammer - Add simple I/O optimization, collect stats on new deduplications
Matthew Dillon [Thu, 4 Aug 2011 02:41:22 +0000 (19:41 -0700)]
hammer - Add simple I/O optimization, collect stats on new deduplications

* Add a simple I/O optimization.  When dealing with CRC collisions scan
  the SHA sub-tree looking for the data_offset/data_len match, allowing
  us to avoid unnecessary I/O reads.

  This effects data which has already been de-duplicated, so it will improve
  dedup rescan times on the portion that has already been dedupped.

* Collect statistics on NEW deduplications during the pass and print them
  out in the final stats as well as in the ^T stats.

8 years agohammer - Collect record statistics, implement ^T and ^C
Matthew Dillon [Thu, 4 Aug 2011 01:42:38 +0000 (18:42 -0700)]
hammer - Collect record statistics, implement ^T and ^C

* Add a check for ^C

* Add a check for ^T and print statistics.

* When doing the dedup for real run a pre-pass on the b-tree to count the
  number of data records present so the ^T feature can print out progress.

  This also has the side effect of doing locality-of-reference disk
  accesses to allow the b-tree data blocks to be cached by the kernel
  (or swapcache) before doing the real pass which will insert random data
  block reads when verifying duplicates.  Due to the efficiencies both passes
  should run faster than the original combined pass, or at least not take
  too much longer.

8 years agoaesni(4): Remove unused variable.
Sascha Wildner [Tue, 2 Aug 2011 15:15:29 +0000 (17:15 +0200)]
aesni(4): Remove unused variable.

8 years agomsk(4): Recognize 88E8402
Sepherosa Ziehau [Tue, 2 Aug 2011 14:09:23 +0000 (22:09 +0800)]
msk(4): Recognize 88E8402

Obtained-from; FreeBSD 198475

8 years agomsk(4): Remove "FIFO overrun" debug logging, which is not critical
Sepherosa Ziehau [Tue, 2 Aug 2011 14:06:38 +0000 (22:06 +0800)]
msk(4): Remove "FIFO overrun" debug logging, which is not critical

Obtained-from: FreeBSD 198997

8 years agomsk(4): Yukon XL can't flush FIFO
Sepherosa Ziehau [Tue, 2 Aug 2011 14:04:22 +0000 (22:04 +0800)]
msk(4): Yukon XL can't flush FIFO

Obtained-from: FreeBSD 197591

8 years agoaesni(4): Properly align the context memory using out kmalloc(9) feature
Sepherosa Ziehau [Tue, 2 Aug 2011 04:11:12 +0000 (12:11 +0800)]
aesni(4): Properly align the context memory using out kmalloc(9) feature

DragonFly's kmalloc(9) will return 2^n aligned memory if the allocation
size is 2^n; use this feature instead of using a local hack.

While I'm here, release the spinlock and call kmalloc(9) w/ M_WAITOK;
the check/free race is absolutely acceptable here, but the failure
of kmalloc(9) w/ M_NOWAIT is probably not accetable on the init path.

8 years agomsk(4): Add Yukon Extreme support
Sepherosa Ziehau [Mon, 1 Aug 2011 11:45:56 +0000 (19:45 +0800)]
msk(4): Add Yukon Extreme support

Obtained-from: FreeBSD 193293 193294 193298 193299

8 years agoadd MLINK for _updwtmpx
Alex Hornung [Sun, 31 Jul 2011 15:03:28 +0000 (16:03 +0100)]
add MLINK for _updwtmpx

8 years agoupdwtmpx - update prototype to be void, but ...
Alex Hornung [Sun, 31 Jul 2011 06:00:42 +0000 (07:00 +0100)]
updwtmpx - update prototype to be void, but ...

 * also expose the int-returning prototype as _updwtmpx, only for internal
   DragonFly use. It seems as if most programs out there assume that
   updwtmpx returns void.

 * This should fix heirloom in pkgsrc

8 years agopthread - adjust visibility to 'default'
Alex Hornung [Sun, 31 Jul 2011 05:52:45 +0000 (06:52 +0100)]
pthread - adjust visibility to 'default'

 * This fixes pkgsrc build issues that think the symbols are hidden.

 * It's not the most elegant solution, and it would be nicer if this
   could somehow be merged into BEGIN_DECLS/END_DECLS, but I couldn't
   find a way to do that.

 * See http://gcc.gnu.org/wiki/Visibility for more details

8 years agomsk(4): 88E80{35,36,37,38} are 100baseT only
Sepherosa Ziehau [Sun, 31 Jul 2011 09:40:44 +0000 (17:40 +0800)]
msk(4): 88E80{35,36,37,38} are 100baseT only

Obtained-from: FreeBSD 192742

8 years agomsk(4): Add Yukon FE+ support
Sepherosa Ziehau [Sun, 31 Jul 2011 09:31:36 +0000 (17:31 +0800)]
msk(4): Add Yukon FE+ support

Obtained-from: FreeBSD 192734 192735 192736

8 years agomsk(4): Explicitly reset GMAC Controls and clear GM_GP_CTRL
Sepherosa Ziehau [Sun, 31 Jul 2011 07:22:32 +0000 (15:22 +0800)]
msk(4): Explicitly reset GMAC Controls and clear GM_GP_CTRL

Obtained-from: FreeBSD 192731

8 years agomsk(4): Disable HW WOL for Yukon EC Ultra
Sepherosa Ziehau [Sun, 31 Jul 2011 07:17:47 +0000 (15:17 +0800)]
msk(4): Disable HW WOL for Yukon EC Ultra

Obtained-from: FreeBSD 192728

8 years agomsk(4): If link is down, don't disable RX/TX MACs if they are not enabled
Sepherosa Ziehau [Sun, 31 Jul 2011 06:53:23 +0000 (14:53 +0800)]
msk(4): If link is down, don't disable RX/TX MACs if they are not enabled

Obtained-from: FreeBSD 192727

8 years agomsk(4): Fix link status detection
Sepherosa Ziehau [Sun, 31 Jul 2011 06:50:06 +0000 (14:50 +0800)]
msk(4): Fix link status detection

Obtained-from: FreeBSD 192727

8 years agomsk(4): Add flag to mark the controller is 100baseTX only
Sepherosa Ziehau [Sun, 31 Jul 2011 06:33:17 +0000 (14:33 +0800)]
msk(4): Add flag to mark the controller is 100baseTX only

Obtained-from: FreeBSD 192723

8 years agomsk(4): Unify PROMISC and ALLMULTI settings
Sepherosa Ziehau [Sun, 31 Jul 2011 06:22:06 +0000 (14:22 +0800)]
msk(4): Unify PROMISC and ALLMULTI settings

Obtained-from: FreeBSD 190314

8 years agocsu x86_64 - properly align stack
Alex Hornung [Sat, 30 Jul 2011 08:04:14 +0000 (09:04 +0100)]
csu x86_64 - properly align stack

 * Properly align the stack for the _init and _fini function calls
   as expected by the x86_64 ABI and gcc.

 * This solves a bus error (unaligned MOVDQA) with pixman and some
   other stuff using SSE.

8 years agodefaults/rc.conf - Add jail_devfs_enable as a known option.
Antonio Huete Jimenez [Fri, 29 Jul 2011 20:09:38 +0000 (22:09 +0200)]
defaults/rc.conf - Add jail_devfs_enable as a known option.

8 years agomanpages: Fix some typos.
Sascha Wildner [Fri, 29 Jul 2011 14:08:04 +0000 (16:08 +0200)]
manpages: Fix some typos.

8 years agovkernel - cpu_disable_intr adjustments
Matthew Dillon [Fri, 29 Jul 2011 08:32:22 +0000 (01:32 -0700)]
vkernel - cpu_disable_intr adjustments

* cpu_disable_intr() also disables IPI interrupts now.

8 years agokernel - Fix rare IPIQ freezes
Matthew Dillon [Fri, 29 Jul 2011 08:25:46 +0000 (01:25 -0700)]
kernel - Fix rare IPIQ freezes

* Ensure that an IPI interrupt is sent went waiting for an IPIQ
  to drain.  The IPIQ can be pushed up by passive IPIs and not
  necessarily have a signal pending on the target cpu, so we
  have to put the check in our drain loop rather than outside
  the loop.

* Add a cpu_pause() to reduce power use for the IPIQ drain case.

* Normalize the use of gd_intr_nesting_level and clean up the
  code syntax for the ipiq_optimized case.

* Remove the previous temporary IPI interrupt signaling fix, it
  was incomplete.

* Fix a missing crit_exit() in the ENOENT case for

* Track cpu's which are in the middle of ipiq processing and
  assert that a cpu is not in an IPIQ processing loop when
  switching between threads.

* Normalize the use of ip->ip_npoll in the IPIQ code.  This
  field is used to avoid unnecessary IPI interrupts.

8 years agovkernel - do not set SA_NODEFER for SIGIO and SIGUSR1
Matthew Dillon [Fri, 29 Jul 2011 08:21:59 +0000 (01:21 -0700)]
vkernel - do not set SA_NODEFER for SIGIO and SIGUSR1

* Do not set SA_NODEFER for SIGIO and SIGUSR1 in vkernels.  This fixes a
  stack overflow which can occur under heavy I/O or IPI loads.

8 years agokernel - Fix signal delivery races
Matthew Dillon [Fri, 29 Jul 2011 08:19:29 +0000 (01:19 -0700)]
kernel - Fix signal delivery races

* The send side was using p->p_token but the processing code from trap
  was still using the mp_lock.  Fix the trap processing code to use

* This fixes several nasty races that can cause signals to be lost and
  vkernels to freeze, and possibly other programs which depend on signals
  between threads.

8 years agokernel - Minor enhancement to ddb's 'ps'
Matthew Dillon [Fri, 29 Jul 2011 08:14:41 +0000 (01:14 -0700)]
kernel - Minor enhancement to ddb's 'ps'

* Add a pointer value in hex for wchan field to DDB's ps output.

8 years agokernel - Fix a small race in the umtx code
Matthew Dillon [Fri, 29 Jul 2011 08:12:08 +0000 (01:12 -0700)]
kernel - Fix a small race in the umtx code

* Add an additional check after registering the vm_page action before
  actually going to sleep, closing a potential vm_token race.

8 years agokernel - remove debugging print_backtrace() when a vkernel is killed
Matthew Dillon [Thu, 28 Jul 2011 23:20:33 +0000 (16:20 -0700)]
kernel - remove debugging print_backtrace() when a vkernel is killed

* In certain cases a debugging print_backtrace() occurs when a vkernel is
  killed while one or more of its cpu threads is active.  This can crash
  64-bit systems.

* Remove the call for now.