dragonfly.git
14 years agoCorrect the logical_cpus calculation in mptable_hyperthread_fixup()
Sepherosa Ziehau [Wed, 17 Jun 2009 11:54:22 +0000 (19:54 +0800)]
Correct the logical_cpus calculation in mptable_hyperthread_fixup()

The original code extracts logical_cpus directly from the output of
cpuid(eax=1), however,
According to Intel's #253668, section 7.7
"(CPUID.1:EBX[23:16]) -- Indicates the maximum number of addressable
 ID for logical processors in a physical package."
According to AMD's #25481 CPUID Fn0000_0001_EBX
"LogicalProcessorCount is the number of threads per CPU core times the
 number of CPU cores per processor."

So what we originally saved in logical_cpus is actually the upper limit
of the logical CPUs per phyical CPU package.  It may work correctly if
there is only one logical CPU per physical CPU package detected in MP
table.  But if more than one logical CPUs per phyical CPU package are
detected in the MP table, then the missing logical CPUs will not be
detected later, since the code assumed that logical_cpus is the number
of logical CPUs missed between two detected logical CPUs.

We try to fix the problem by calculating the distances between two nearest
APIC IDs.  If all such distances for all detect logical CPUs are same,
then the logical_cpus is set the calculated distance.  The value extracted
from cpuid(eax=1) just serves as the upper limit of the logical_cpus now.

Reported-and-Tested-by: Robert Luciani <rluciani@gmail.com>
14 years agoMerge branch 'vendor/LIBARCHIVE'
Peter Avalos [Mon, 22 Jun 2009 02:06:50 +0000 (16:06 -1000)]
Merge branch 'vendor/LIBARCHIVE'

14 years agoAdd README.DELETED to libarchive's vendor branch.
Peter Avalos [Mon, 22 Jun 2009 02:04:39 +0000 (16:04 -1000)]
Add README.DELETED to libarchive's vendor branch.

14 years agoMerge branch 'vendor/LIBARCHIVE'
Peter Avalos [Sun, 21 Jun 2009 22:00:54 +0000 (12:00 -1000)]
Merge branch 'vendor/LIBARCHIVE'

14 years agoMerge branch 'vendor/LIBARCHIVE' (early part)
Peter Avalos [Sun, 21 Jun 2009 21:48:22 +0000 (11:48 -1000)]
Merge branch 'vendor/LIBARCHIVE' (early part)

14 years agoRename libarchive-2/ to libarchive/. No need for it to be versioned.
Peter Avalos [Sun, 21 Jun 2009 21:45:01 +0000 (11:45 -1000)]
Rename libarchive-2/ to libarchive/.  No need for it to be versioned.

14 years agoRemove old versions of libarchive.
Peter Avalos [Sun, 21 Jun 2009 21:44:30 +0000 (11:44 -1000)]
Remove old versions of libarchive.

14 years agoRemove GNU cpio.
Peter Avalos [Sun, 21 Jun 2009 21:32:18 +0000 (11:32 -1000)]
Remove GNU cpio.

14 years agopnpinfo(8): Oops, add missing semicolons.
Sascha Wildner [Sun, 21 Jun 2009 21:24:35 +0000 (23:24 +0200)]
pnpinfo(8): Oops, add missing semicolons.

14 years agodiff(1): Commit our patches to contrib/ and get rid of -I-.
Sascha Wildner [Sun, 21 Jun 2009 19:06:56 +0000 (21:06 +0200)]
diff(1): Commit our patches to contrib/ and get rid of -I-.

14 years agoMerge branch 'master' of /home/www-data/gitweb/dragonfly
Peter Avalos [Sun, 21 Jun 2009 18:42:58 +0000 (08:42 -1000)]
Merge branch 'master' of /home/www-data/gitweb/dragonfly

14 years agoMerge branch 'vendor/LESS'
Peter Avalos [Sun, 21 Jun 2009 18:40:42 +0000 (08:40 -1000)]
Merge branch 'vendor/LESS'

14 years agoUpgrade to less-429.
Peter Avalos [Sun, 21 Jun 2009 18:31:16 +0000 (08:31 -1000)]
Upgrade to less-429.

* The -D option with one number now means use the normal background color.
* Don't change permissions on history file if it is not a regular file.
* Fix non-ANSI-compliant code that caused problems with some compilers.
* Fix binary file detection in UTF-8 mode.
* Fix display problems with long lines on "ignaw" terminals.
* Fix problem interrupting the line number calculation for initial prompt.
* Fix SGR emulation when dealing with multiple attributes (eg.
bold+underline).
* Fix highlight bug when searching for underlined/overstruck text.
* New "&" command allows filtering of lines based on a pattern.
* Status column now displays a search match, even if the matched string is
scrolled off screen because -S is in effect.
* Improve behavior of -F option.
* Allow CSI character (0x9B) to work in UTF-8 mode.
* Output carriage return at startup in case terminal doesn't default to
column 1.
* Fix bug in '' (quote, quote) command after G command.

14 years agoAdd README.DELETED to the vendor/LESS branch.
Peter Avalos [Sun, 21 Jun 2009 18:27:17 +0000 (08:27 -1000)]
Add README.DELETED to the vendor/LESS branch.

14 years agoMerge branch 'vendor/LESS'
Peter Avalos [Sun, 21 Jun 2009 18:26:30 +0000 (08:26 -1000)]
Merge branch 'vendor/LESS'

14 years agopnpinfo(8): isolation_protocol() takes no arguments.
Sascha Wildner [Sun, 21 Jun 2009 18:08:31 +0000 (20:08 +0200)]
pnpinfo(8): isolation_protocol() takes no arguments.

While here, clean up a bit, fix a couple of warnings and raise WARNS to 6.

14 years agoMove less-4/ to less/. No need for versioned directories.
Peter Avalos [Sun, 21 Jun 2009 18:05:12 +0000 (08:05 -1000)]
Move less-4/ to less/.  No need for versioned directories.

14 years agoRemove old versions of less.
Peter Avalos [Sun, 21 Jun 2009 18:02:47 +0000 (08:02 -1000)]
Remove old versions of less.

14 years agoAdd MD, optimized versions of string functions for amd64.
Peter Avalos [Sun, 26 Apr 2009 04:46:03 +0000 (04:46 +0000)]
Add MD, optimized versions of string functions for amd64.

Obtained-from: FreeBSD

14 years agoAdd amd64 assembly versions of div(3), ldiv(3), and lldiv(3).
Peter Avalos [Sun, 26 Apr 2009 04:23:41 +0000 (04:23 +0000)]
Add amd64 assembly versions of div(3), ldiv(3), and lldiv(3).

Obtained-from: FreeBSD

14 years agoUpdate some of the amd64 parts of libc:
Peter Avalos [Sun, 26 Apr 2009 03:57:31 +0000 (03:57 +0000)]
Update some of the amd64 parts of libc:

* Change the syscall stub branch orders so that the static branch
prediction will assume that syscalls will succeed rather than fail.

* Add error handling for PSEUDO syscalls.

* Add END() macros for Assembler code. This causes the symbol
table to include the size of the function.

* ldexp:  Fix a typo in the !__GNUC__ case and remove an obsolete
comment.

* setjmp/longjmp changes:
-Save and restore the control part of the MXCSR in addition to the
i387 control word to ensure that the two are consistent.
-Don't clobber the FPU exception flags in longjmp. C99 requires them
to remain unchanged.

Obtained-from: FreeBSD

14 years agoSync with i386's _fpmath.h:
Peter Avalos [Fri, 24 Apr 2009 04:10:45 +0000 (04:10 +0000)]
Sync with i386's _fpmath.h:

* Define LDBL_NBIT to be a mask indicating the position of the integer
bit in a long double.

* Add an alternative view of the bits in an 80-bit long double (64+16
instead of 32+32+15+1).

Obtained-from: FreeBSD

14 years agoDefine an END() macro for use in i386 and amd64 assembly code.
Peter Avalos [Sun, 21 Jun 2009 02:43:11 +0000 (16:43 -1000)]
Define an END() macro for use in i386 and amd64 assembly code.

Obtained-from: FreeBSD

14 years agoRemove dead code (_ARCH_INDIRECT) from <machine/asm.h>.
Peter Avalos [Sun, 21 Jun 2009 02:35:27 +0000 (16:35 -1000)]
Remove dead code (_ARCH_INDIRECT) from <machine/asm.h>.

14 years agoAllow pre-2.3 systems to build the new version of file.
Peter Avalos [Sun, 21 Jun 2009 08:07:22 +0000 (08:07 +0000)]
Allow pre-2.3 systems to build the new version of file.

Add a few things under COMPILE_ONLY so systems without strtof and/or
daylight can still build the host tool.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sun, 21 Jun 2009 02:40:31 +0000 (19:40 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoHAMMER VFS - Implement inode number matching against the directory hash
Matthew Dillon [Sun, 21 Jun 2009 02:29:57 +0000 (19:29 -0700)]
HAMMER VFS - Implement inode number matching against the directory hash

Change hammer_create_inode() and hammer_alloc_objid() to take the upper
10 bits of the filename hash and attempt to use them as the lower 10 bits
of the inode number.

hammer_alloc_objid() now utilizes a small two-level 1024-bit bitmap to
assign the low 10 bits of the inode number, on a per-directory basis.
If a collision occurs a nearby value is used instead.

The idea is for inode numbers to have approximately the same linearity
as the directory read scan order, so programs such as cpio, tar, cpdup,
find, and ls which do recursive scans of the directory tree get much
better locality of reference for stat() and other related system calls.

Based-on: Numerous discussions with people, esp corecode.

14 years agocpdup - Do not create a .tmp file and rename if the target does not exist.
Matthew Dillon [Sun, 21 Jun 2009 02:25:26 +0000 (19:25 -0700)]
cpdup - Do not create a .tmp file and rename if the target does not exist.

* When copying if the target does not exist use the target's actual name
  instead of the name of a temporary file.

  This helps filesystems (aka HAMMER) which use hashed directories.  Inode
  numbers can be selected by the FS on the basis of the file-name in
  order to maintain directory-order linearity.  If the copy program creates
  the target file with one name and then renames it to the real name,
  however, the feature is lost and we get one big scramble again.

14 years agoMerge branch 'vendor/FILE'
Peter Avalos [Sun, 21 Jun 2009 00:48:42 +0000 (14:48 -1000)]
Merge branch 'vendor/FILE'

14 years agoUpgrade to file-5.03.
Peter Avalos [Sat, 20 Jun 2009 23:57:23 +0000 (13:57 -1000)]
Upgrade to file-5.03.

Changes can be viewed in the ChangeLog file.

14 years agoHAMER VFS - Cache additional b-tree nodes in directory.
Matthew Dillon [Sat, 20 Jun 2009 23:53:21 +0000 (16:53 -0700)]
HAMER VFS - Cache additional b-tree nodes in directory.

* Cache inode record cursors in the directory at dip->cache[2] to reduce
  cpu overhead when iterating a directory.

* Cache file object record cursors in the file's governing directory at
  dip->cache[3] after reading the last data record in a file, to reduce
  cpu overhead when chain-reading files.

* Also add vfs.hammer.stats_btree_root_iterations, a counter which
  is incremented whenever a B-Tree search is initiated from the root
  node.

14 years agoMerge branch 'vendor/FILE'
Peter Avalos [Sat, 20 Jun 2009 22:20:03 +0000 (12:20 -1000)]
Merge branch 'vendor/FILE'

14 years agoAdd README.DELETED to file's vendor branch.
Peter Avalos [Sat, 20 Jun 2009 22:18:24 +0000 (12:18 -1000)]
Add README.DELETED to file's vendor branch.

14 years agoMerge branch 'vendor/FILE'
Peter Avalos [Sat, 20 Jun 2009 22:07:26 +0000 (12:07 -1000)]
Merge branch 'vendor/FILE'

14 years agoMerge branch 'vendor/FILE' (early part)
Peter Avalos [Sat, 20 Jun 2009 22:00:13 +0000 (12:00 -1000)]
Merge branch 'vendor/FILE' (early part)

14 years agoMove file-4/ to file/. We don't need a versioned directory.
Peter Avalos [Sat, 20 Jun 2009 21:57:20 +0000 (11:57 -1000)]
Move file-4/ to file/.  We don't need a versioned directory.

14 years agoRemove old versions of file.
Peter Avalos [Sat, 20 Jun 2009 21:56:41 +0000 (11:56 -1000)]
Remove old versions of file.

14 years agoHAMMER VFS - Add hinting capability to block allocator, hint B-Tree
Matthew Dillon [Sat, 20 Jun 2009 21:49:12 +0000 (14:49 -0700)]
HAMMER VFS - Add hinting capability to block allocator, hint B-Tree

* A hammer_off_t can now be supplied to the blockmap allocator as a hint.

* Use the hinting mechanism to better-localize B-Tree node allocations
  and meta-data updates.

14 years agoiostat - Increase the tps field width from 3 to 4.
Matthew Dillon [Sat, 20 Jun 2009 21:07:33 +0000 (14:07 -0700)]
iostat - Increase the tps field width from 3 to 4.

* Standard workloads now easily push the tps rate into the 4 digits.
  Increase the tps field with to 4.

14 years agoMerge branch 'vendor/OPENSSH'
Peter Avalos [Sat, 20 Jun 2009 21:04:55 +0000 (11:04 -1000)]
Merge branch 'vendor/OPENSSH'

14 years agoUpgrade to OpenSSH-5.2p1.
Peter Avalos [Sat, 20 Jun 2009 18:55:46 +0000 (08:55 -1000)]
Upgrade to OpenSSH-5.2p1.

Security:

 * This release changes the default cipher order to prefer the AES CTR
   modes and the revised "arcfour256" mode to CBC mode ciphers that are
   susceptible to CPNI-957037 "Plaintext Recovery Attack Against SSH".

 * This release also adds countermeasures to mitigate CPNI-957037-style
   attacks against the SSH protocol's use of CBC-mode ciphers. Upon
   detection of an invalid packet length or Message Authentication
   Code, ssh/sshd will continue reading up to the maximum supported
   packet length rather than immediately terminating the connection.
   This eliminates most of the known differences in behaviour that
   leaked information about the plaintext of injected data which formed
   the basis of this attack. We believe that these attacks are rendered
   infeasible by these changes.

New features:

 * Added a -y option to ssh(1) to force logging to syslog rather than
   stderr, which is useful when running daemonised (ssh -f)

 * The sshd_config(5) ForceCommand directive now accepts commandline
   arguments for the internal-sftp server.

 * The ssh(1) ~C escape commandline now support runtime creation of
   dynamic (-D) port forwards.

 * Support the SOCKS4A protocol in ssh(1) dynamic (-D) forwards.
   (bz#1482)

 * Support remote port forwarding with a listen port of '0'. This
   informs the server that it should dynamically allocate a listen
   port and report it back to the client. (bz#1003)

 * sshd(8) now supports setting PermitEmptyPasswords and
   AllowAgentForwarding in Match blocks

Bug and documentation fixes

 * Repair a ssh(1) crash introduced in openssh-5.1 when the client is
   sent a zero-length banner (bz#1496)

 * Due to interoperability problems with certain
   broken SSH implementations, the eow@openssh.com and
   no-more-sessions@openssh.com protocol extensions are now only sent
   to peers that identify themselves as OpenSSH.

 * Make ssh(1) send the correct channel number for
   SSH2_MSG_CHANNEL_SUCCESS and SSH2_MSG_CHANNEL_FAILURE messages to
   avoid triggering 'Non-public channel' error messages on sshd(8) in
   openssh-5.1.

 * Avoid printing 'Non-public channel' warnings in sshd(8), since the
   ssh(1) has sent incorrect channel numbers since ~2004 (this reverts
   a behaviour introduced in openssh-5.1).

 * Avoid double-free in ssh(1) ~C escape -L handler (bz#1539)

 * Correct fail-on-error behaviour in sftp(1) batchmode for remote
   stat operations. (bz#1541)

 * Disable nonfunctional ssh(1) ~C escape handler in multiplex slave
   connections. (bz#1543)

 * Avoid hang in ssh(1) when attempting to connect to a server that
   has MaxSessions=0 set.

 * Multiple fixes to sshd(8) configuration test (-T) mode

 * Several core and portable OpenSSH bugs fixed: 1380, 1412, 1418,
   1419, 1421, 1490, 1491, 1492, 1514, 1515, 1518, 1520, 1538, 1540

 * Many manual page improvements.

14 years agoAdd README.DELETED to the OpenSSH's vendor branch.
Peter Avalos [Sat, 20 Jun 2009 18:29:52 +0000 (08:29 -1000)]
Add README.DELETED to the OpenSSH's vendor branch.

14 years agoMerge branch 'vendor/OPENSSH'
Peter Avalos [Sat, 20 Jun 2009 18:21:37 +0000 (08:21 -1000)]
Merge branch 'vendor/OPENSSH'

14 years agoMerge branch 'vendor/OPENSSH' (early part)
Peter Avalos [Sat, 20 Jun 2009 18:14:52 +0000 (08:14 -1000)]
Merge branch 'vendor/OPENSSH' (early part)

14 years agoMove openssh-5/ to openssh/. We don't need a versioned directory.
Peter Avalos [Sat, 20 Jun 2009 18:01:56 +0000 (08:01 -1000)]
Move openssh-5/ to openssh/.  We don't need a versioned directory.

14 years agoRemove old versions of OpenSSH.
Peter Avalos [Sat, 20 Jun 2009 18:01:16 +0000 (08:01 -1000)]
Remove old versions of OpenSSH.

14 years agolibmd: Raise WARNS to 2 and fix a warning.
Sascha Wildner [Thu, 18 Jun 2009 21:58:29 +0000 (23:58 +0200)]
libmd: Raise WARNS to 2 and fix a warning.

14 years agoRaise WARNS level of several libraries.
Sascha Wildner [Thu, 18 Jun 2009 23:00:38 +0000 (01:00 +0200)]
Raise WARNS level of several libraries.

14 years agoAdd sys/boot/pc32/boot0sio to the build.
Sascha Wildner [Sat, 20 Jun 2009 17:41:08 +0000 (19:41 +0200)]
Add sys/boot/pc32/boot0sio to the build.

Also mention it in boot0cfg.8 (taken from FreeBSD).

While here, also do some minor cleanup of the manual page.

14 years agoHAMMER UTILITY - reorg cache, add -C, document blockmap and show command.
Matthew Dillon [Sat, 20 Jun 2009 17:31:39 +0000 (10:31 -0700)]
HAMMER UTILITY - reorg cache, add -C, document blockmap and show command.

* Reorganize the way the local block cache works (in the utility, not the
  filesystem).  Add the -C option to specify cache size and read-ahead.

* Document the blockmap command and enhance the documentation for the show
  command.

14 years agoHAMMER (and kernel) - Fix cpu-bound kernel thread issue.
Matthew Dillon [Sat, 20 Jun 2009 00:04:31 +0000 (17:04 -0700)]
HAMMER (and kernel) - Fix cpu-bound kernel thread issue.

* HAMMER now calls a new kernel function, lwkt_user_yield(), in its
  ioctl-based loops (such as the reblocker).

* Add a new LWKT function called lwkt_user_yield().  This function
  causes a kernel thread to yield at user priority (instead of kernel
  priority).

  This function also deals with a nasty issue related to the MP lock.
  A cpu-bound kernel thread holding the MP lock can prevent other
  cpus from serving interrupt threads which also need the MP lock.
  Detect the condition and release the MP lock for 10uS to give the
  other cpus a chance to pick it up.  This is a bad hack but it
  actually does work.

* Move passive_release() from MD code to kern/lwkt_thread.c and add
  an inline for the passive release recovery function.  Adjust all
  platforms to use the new API instead of rolling the same code for
  each platform.

Reported-by: Many, but especially Hasso Tepper <hasso@estpak.ee>
14 years agoHAMMER UTIL - Add -C cachesize option to improve the 'show' command.
Matthew Dillon [Fri, 19 Jun 2009 17:25:12 +0000 (10:25 -0700)]
HAMMER UTIL - Add -C cachesize option to improve the 'show' command.

* Allows the default in-memory cache size of 16m to be changed.

14 years agoHAMMER UTIL - Add minor verboseness to "show"
Matthew Dillon [Fri, 19 Jun 2009 17:20:35 +0000 (10:20 -0700)]
HAMMER UTIL - Add minor verboseness to "show"

14 years agoAHCI - Correct prdbc warning.
Matthew Dillon [Fri, 19 Jun 2009 16:04:22 +0000 (09:04 -0700)]
AHCI - Correct prdbc warning.

* This field is only updated by hardware for non-NCQ packets, don't
  spew warnings if it is zero for NCQ packets.

Reported-by: Sepherosa Ziehau <sepherosa@gmail.com>
14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 19 Jun 2009 07:02:23 +0000 (00:02 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoSILI - Minor fixes and adjustments.
Matthew Dillon [Fri, 19 Jun 2009 06:59:19 +0000 (23:59 -0700)]
SILI - Minor fixes and adjustments.

* Aligned scratch space for READ LOG

* Better exclusivity code.  Minor fix to only copy-back the rfis
  if the CCB was on-chip, instead of unconditionally.

* Probe all ports reported by the PM, we'll have to adjust for
  'fake' disks at the end of the PM port chain more specifically.

14 years agoAHCI - Intel fixes, error processing fixes.
Matthew Dillon [Fri, 19 Jun 2009 06:49:07 +0000 (23:49 -0700)]
AHCI - Intel fixes, error processing fixes.

* Allocate separate scratch space to enforce a reasonable alignment
  for the READ LOG page.

* Fix numerous issues with READ LOG / NCQ error processing.  READ LOG
  wasn't working at all before.

* Intel fixes.  Move the SDBE interrupt from the AsyncNotify-only
  code to the general code.  Intel parts seem to use this interrupt
  (and not DPE) to signal completion for NCQ commands, so we get
  timeouts if we don't use it generally.

* Rearrange a great deal of code in a manner similar to how the
  Sili driver was arranged.  Primarily: ATA_F_AUTOSENSE to
  acquire D2H rfis's more reliably, and ATA_F_EXCLUSIVE.  More work
  needs to be done.  Also move the PM probe code to the PM source
  module.

* Add code to deal with D2H ERR fises.  These generate a DHRS
  interrupt but only those which post an ERR in the task file
  stop command processing.  This is not well documented in the
  AHCI specs.

14 years agoSync zoneinfo database with tzdata2009j from elsie.
Sascha Wildner [Thu, 18 Jun 2009 13:39:50 +0000 (15:39 +0200)]
Sync zoneinfo database with tzdata2009j from elsie.

asia:           8.34 -> 8.35

As Bangladesh's start of DST on June 19 is now official, simplify the
last change.

14 years agoRemove trailing whitespace.
Sascha Wildner [Thu, 18 Jun 2009 13:38:24 +0000 (15:38 +0200)]
Remove trailing whitespace.

14 years agopriv: Narrow down privileges
Michael Neumann [Thu, 18 Jun 2009 10:32:07 +0000 (12:32 +0200)]
priv: Narrow down privileges

14 years agopriv: Narrow down privileges
Michael Neumann [Thu, 18 Jun 2009 10:01:19 +0000 (12:01 +0200)]
priv: Narrow down privileges

Leave PRISON_ROOT for now despite having a separate privilege for
the prison case. PRISON_ROOT will be removed in a later step, once
all jail privileges have been determined.

14 years agopriv: Narrow down privileges
Michael Neumann [Thu, 18 Jun 2009 09:56:32 +0000 (11:56 +0200)]
priv: Narrow down privileges

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 18 Jun 2009 07:56:32 +0000 (00:56 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoSILI - Fix port re-insertion probe problems when coming out of DET_INIT
Matthew Dillon [Thu, 18 Jun 2009 07:52:45 +0000 (00:52 -0700)]
SILI - Fix port re-insertion probe problems when coming out of DET_INIT

* When a port is pulled we enter into a listen state where we program
  SCTL to the DET_INIT state to send a continuous stream of COMRESETs.

  When a port is plugged back in we clear the DET_INIT state.  However,
  we were not waiting nearly long enough for the PHY to renegotiate!
  It can take up to 4 seconds!

  Add a polling loop to wait for the PHY to renegotiate before we start
  the DEVRESET sequence.  If we start the sequence too early the PHY
  will still be unstable and the DEVRESET sequence or something following
  it will likely fail with a fatal error interrupt (usually error code 4).

* Reduce the physical port insertion delay to 7 seconds.  Leave the
  PM port insertion delay at 10 seconds.

14 years agoBuild the packages for our our LiveCD/DVD with options "dri" & "inet6".
Sascha Wildner [Thu, 18 Jun 2009 07:46:57 +0000 (09:46 +0200)]
Build the packages for our our LiveCD/DVD with options "dri" & "inet6".

Recommended-by: hasso
14 years agoSILI - Reorganize the probe code, fix CAM startup issues, remove debugging
Matthew Dillon [Thu, 18 Jun 2009 03:45:49 +0000 (20:45 -0700)]
SILI - Reorganize the probe code, fix CAM startup issues, remove debugging

* Do a major reorganization of the probe code.  It is MUCH faster now and
  should reliably detect PMs and direct-attached disks.

* Fix an issue in the CAM code.

* Remove a lot of the debugging kprintfs.

14 years agoSILI - Get read log page 10 working, improve error handling.
Matthew Dillon [Wed, 17 Jun 2009 23:36:20 +0000 (16:36 -0700)]
SILI - Get read log page 10 working, improve error handling.

* Finish up implementing the NCQ log page handling code.

* The recursion check for sili_port_reinit() was insufficient, fix it.

14 years agoFix amd64 compile issue: I386_BUS_SPACE_IO -> AMD64_BUS_SPACE_IO.
Matthew Dillon [Wed, 17 Jun 2009 22:45:56 +0000 (15:45 -0700)]
Fix amd64 compile issue: I386_BUS_SPACE_IO -> AMD64_BUS_SPACE_IO.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 17 Jun 2009 21:56:33 +0000 (14:56 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoFix typo
Michael Neumann [Wed, 17 Jun 2009 21:52:49 +0000 (23:52 +0200)]
Fix typo

14 years agoCCD - Allow ccd to be kldunload'd.
Matthew Dillon [Wed, 17 Jun 2009 21:50:03 +0000 (14:50 -0700)]
CCD - Allow ccd to be kldunload'd.

14 years agodisk subsystem - Fixup dev->si_* fields for XXXs0, e.g. da0s0
Matthew Dillon [Wed, 17 Jun 2009 21:01:47 +0000 (14:01 -0700)]
disk subsystem - Fixup dev->si_* fields for XXXs0, e.g. da0s0

The si_* fields for rawdev are not set until after the disk_create()
call, so someone using the cooked version of the raw device (i.e. da0s0)
will not get the right si_iosize_max unless we fix it up here.

14 years agopriv: Narrow down privileges
Michael Neumann [Wed, 17 Jun 2009 20:59:18 +0000 (22:59 +0200)]
priv: Narrow down privileges

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Michael Neumann [Wed, 17 Jun 2009 20:27:55 +0000 (22:27 +0200)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agopriv: Narrow down privileges; new PRIV_JAIL_CREATE
Michael Neumann [Wed, 17 Jun 2009 20:25:43 +0000 (22:25 +0200)]
priv: Narrow down privileges; new PRIV_JAIL_CREATE

14 years agopriv: Narrow down privileges
Michael Neumann [Wed, 17 Jun 2009 20:23:11 +0000 (22:23 +0200)]
priv: Narrow down privileges

14 years agoSILI - Work around hardware LRAM bugs part 2/2.
Matthew Dillon [Wed, 17 Jun 2009 19:33:56 +0000 (12:33 -0700)]
SILI - Work around hardware LRAM bugs part 2/2.

* Add ATA_F_AUTOSENSE and ATA_F_EXCLUSIVE to deal with accessing the
  D2H RFIS.

  ATA_F_AUTOSENSE tells sili.c that the caller wants to access the rfis.
  The sili core is then responsible for copying the rfis out of the LRAM
  and into host-memory.

  ATA_F_EXCLUSIVE tells sili.c that the caller wants to be the only
  command queued to the chip for that particular command.

* Currently ATA_F_AUTOSENSE implies ATA_F_EXCLUSIVE, but ultimately we will
  want to do the auto-sense as a separate step so things like ATAPI farms
  can run commands in parallel.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 17 Jun 2009 19:32:51 +0000 (12:32 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoPCIDEVS - Add vendors
Matthew Dillon [Wed, 17 Jun 2009 19:31:13 +0000 (12:31 -0700)]
PCIDEVS - Add vendors

* Add PCI_VENDOR_SII (0x1095)
* Add PCI_PRODUCT_SII_3132 (0x3132)

14 years agoDEVS - Clean up some reference counting issues
Matthew Dillon [Wed, 17 Jun 2009 19:29:13 +0000 (12:29 -0700)]
DEVS - Clean up some reference counting issues

* Add dev_ops_remove_override() as the counterpart to dev_ops_add_override().

* Do not complain if ops->head.refs is non-zero when deleting ops,
  as the ops structure might be used with other unit numbers.

* Fix a bad assertion that was leading to incorrect panics when selectively
  removing dev_ops.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Michael Neumann [Wed, 17 Jun 2009 19:22:59 +0000 (21:22 +0200)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agopriv: Introduce PRIV_VM_RESIDENT and use it
Michael Neumann [Wed, 17 Jun 2009 19:21:36 +0000 (21:21 +0200)]
priv: Introduce PRIV_VM_RESIDENT and use it

14 years agopriv: Narrow down privileges
Michael Neumann [Wed, 17 Jun 2009 19:18:45 +0000 (21:18 +0200)]
priv: Narrow down privileges

14 years agoSILI - Work around hardware LRAM bugs part 1/2.
Matthew Dillon [Wed, 17 Jun 2009 17:27:00 +0000 (10:27 -0700)]
SILI - Work around hardware LRAM bugs part 1/2.

After tearing my hair out a bit and wondering why the Sili chip couldn't
have more then one command pending on a port at a time when talking to a PM,
I found an issue reported in the Linux sili device driver related to its
LRAM.  Basically, reading from the Sili chip's LRAM while commands are active
will corrupt it.

The solution is to use a completely external PRB rather then the PRB in
the LRAM, and use the command activation register to start the command
instead of the command FIFO (which only works for the fixed PRBs in the LRAM).

This commit fixes basic command dispatch but does not yet handle situations
where the RFIS must be read from the LRAM... for example, when reading data
from a PM SCA register or reading sense data from an ATAPI command.  With
this commit I can dd from 5 drives behind a PM in parallel.

14 years agoFix kernel compile error in last commit due to lack of types.h in some sources
Matthew Dillon [Wed, 17 Jun 2009 16:50:12 +0000 (09:50 -0700)]
Fix kernel compile error in last commit due to lack of types.h in some sources

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 17 Jun 2009 15:32:14 +0000 (08:32 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoBUSDMA - Add bus_space_kva()
Matthew Dillon [Wed, 17 Jun 2009 15:31:12 +0000 (08:31 -0700)]
BUSDMA - Add bus_space_kva()

* Add bus_space_kva(), a function which returns a real pointer to access
  things like mapped shared memory (used by SILI).

-Matt

14 years agosh(1): Reset getopt(3) before executing built-in commands.
Stathis Kamperis [Wed, 17 Jun 2009 13:21:16 +0000 (16:21 +0300)]
sh(1): Reset getopt(3) before executing built-in commands.

Before patch:
$ printf "test\n"
test
$ jobs -l
$ printf "test\n"
usage: printf format [arg ...]
$

After patch:
$ printf "test\n"
test
$ jobs -l
$ printf "test\n"
test
$

The bug isn't tight to jobs(1) or printf(1). Every use of getopt(3) would
advance `optind' and make the next built-in command think that it wasn't
supplied with enough arguments. NetBSD is doing as we do. FreeBSD doesn't
have printf(1) as built-in so it is not affected. The patch has survived
a build{world, kernel}.

14 years agoAHCI - Remove DIAGNOSTICs
Matthew Dillon [Wed, 17 Jun 2009 08:26:10 +0000 (01:26 -0700)]
AHCI - Remove DIAGNOSTICs

They don't compile anyway.

Reported-by: Sascha Wildner <saw@online.de>
14 years agoAHCI - Bring fixes in from SILI.
Matthew Dillon [Wed, 17 Jun 2009 06:54:54 +0000 (23:54 -0700)]
AHCI - Bring fixes in from SILI.

* Use ahci_os_softsleep() more

* Clean out active and pending CCBs when a port is disconnected, fixing
  hangs of programs that were accessing the disks at the time.

* Clear ap_expired bitmap when completing a CCB.

* Fix max_target specification so CAM bus scans only run through 15.

* Lock port around ATAPI command

14 years agoSILI - Silicon Image 3132 driver, initial commit
Matthew Dillon [Wed, 17 Jun 2009 06:43:24 +0000 (23:43 -0700)]
SILI - Silicon Image 3132 driver, initial commit

This driver was derived from the AHCI driver and retooled extensively
for the Silicon Image chipset.  It retains all the cool features from the
AHCI driver including port multiplier (PM) support, NCQ, and hot-plug for
both direct-attached and PM-attached targets.

This initial commit is very alpha and the driver has significant PM-related
bugs.  It is not yet ready for prime time.

14 years agoCAM - Change XPORT_AHCI to XPORT_SATA.
Matthew Dillon [Wed, 17 Jun 2009 05:00:13 +0000 (22:00 -0700)]
CAM - Change XPORT_AHCI to XPORT_SATA.

Noticed-by: corecode
14 years agoAHCI - separate pmreg.h out, always zero the FIS in ahci_ata_get_xfer()
Matthew Dillon [Tue, 16 Jun 2009 19:02:16 +0000 (12:02 -0700)]
AHCI - separate pmreg.h out, always zero the FIS in ahci_ata_get_xfer()

* Separate the register defs for PMs out into pmreg.h, as they are not
  AHCI-specific.

* Always zero the FIS returned by ahic_ata_get_xfer().  Don't let any cruft
  accumulate.

14 years agoAHCI - augment ahci_pm_check_good() to handle targets larger then pmcount.
Matthew Dillon [Tue, 16 Jun 2009 01:38:33 +0000 (18:38 -0700)]
AHCI - augment ahci_pm_check_good() to handle targets larger then pmcount.

14 years agoAHCI - go back to reading the EINFO register, check for unexpected EINFO bits
Matthew Dillon [Tue, 16 Jun 2009 01:36:16 +0000 (18:36 -0700)]
AHCI - go back to reading the EINFO register, check for unexpected EINFO bits

* Go back to reading the EINFO register.  We still have some issues with
  the PM not generating an interrupt for target port change events, this
  may clear it up.

* Report unexpected EINFO bits set beyond the number of supported targets.

14 years agoAHCI - add new kenv "hint.ahci.nofeatures"
Matthew Dillon [Mon, 15 Jun 2009 23:04:23 +0000 (16:04 -0700)]
AHCI - add new kenv "hint.ahci.nofeatures"

set hint.ahci.nofeatures in /boot/loader.conf or at the boot loader command
line to tell the AHCI driver not to attempt to set the security freeze on
a device.  Some devices will stop operating.

14 years agoAHCI - Add additional information in the CMD TIMEOUT message.
Matthew Dillon [Mon, 15 Jun 2009 22:04:16 +0000 (15:04 -0700)]
AHCI - Add additional information in the CMD TIMEOUT message.

* Also dump the STS state when printing the CMD TIMEOUT messeage.

14 years agoSet tty ownership on pty open (temporary until devfs is integrated)
Matthew Dillon [Mon, 15 Jun 2009 21:50:06 +0000 (14:50 -0700)]
Set tty ownership on pty open (temporary until devfs is integrated)

Fix a very long standing issue when opening new pty's as non-root.  The
related tty could not be chowned/chmoded in that case, giving any user
in the system access to the pty.

This would not effect programs like sshd which set up the pty as root, but
it did effect programs like xterm which do not run suid-root.

This is strictly a temporary fix until devfs can be integrated into the
system.  Basically we allow the uid stored in the cdev_t structure to
override the uid returned by VOP_GETATTR for VCHR devices, and the chmod
helper function checks the uid stored in the cdev_t structure for
compatibility.

Reported-by: Hasso Tepper <hasso@estpak.ee>, Numerous others
14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 15 Jun 2009 16:31:15 +0000 (09:31 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoAHCI - Add hint.ahci.force150. Force negotiation at 1.5GBits.
Matthew Dillon [Mon, 15 Jun 2009 16:13:42 +0000 (09:13 -0700)]
AHCI - Add hint.ahci.force150.  Force negotiation at 1.5GBits.

* Add a feature which forces the AHCI controller to negotiate at 1.5 GBits
  instead of 3 GBits.