games.git
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 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 (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.

14 years agoahci.4: Fix typo.
Sascha Wildner [Mon, 15 Jun 2009 00:11:34 +0000 (02:11 +0200)]
ahci.4: Fix typo.

14 years agoAdd an ahci(4) manual page from OpenBSD (with some adaptation).
Sascha Wildner [Sun, 14 Jun 2009 23:51:01 +0000 (01:51 +0200)]
Add an ahci(4) manual page from OpenBSD (with some adaptation).

14 years agoAdjust the LiveDVD's beastie.4th too for the AHCI option.
Sascha Wildner [Sun, 14 Jun 2009 22:45:34 +0000 (00:45 +0200)]
Adjust the LiveDVD's beastie.4th too for the AHCI option.

14 years agoGENERIC kernel build - build-in the AHCI driver.
Matthew Dillon [Sun, 14 Jun 2009 22:33:47 +0000 (15:33 -0700)]
GENERIC kernel build - build-in the AHCI driver.

* The ahci driver is now part of the GENERIC kernel build.

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

14 years agoAHCI - Add kenv "boot.hint.ahci_disabled", and add a boot menu option for it
Matthew Dillon [Sun, 14 Jun 2009 22:30:53 +0000 (15:30 -0700)]
AHCI - Add kenv "boot.hint.ahci_disabled", and add a boot menu option for it

* Setting the variable "boot.hint.ahci_disabled" in the boot loader will
  disable the AHCI driver's probe, causing AHCI devices to fall back to
  the NATA driver.

* The boot menu now has an option to boot with the AHCI driver disabled.

14 years agosbin/hammer/cmd_mirror.c: Stick with style(9) bracing style.
Sascha Wildner [Sun, 14 Jun 2009 18:18:14 +0000 (20:18 +0200)]
sbin/hammer/cmd_mirror.c: Stick with style(9) bracing style.

14 years agoAHCI - Minor console output spew cleanup
Matthew Dillon [Sun, 14 Jun 2009 17:40:38 +0000 (10:40 -0700)]
AHCI - Minor console output spew cleanup

14 years agoSimplify logical expression
Michael Neumann [Sun, 14 Jun 2009 16:52:03 +0000 (18:52 +0200)]
Simplify logical expression

14 years agoImplement -y "force yes" option for hammer utility.
Michael Neumann [Sun, 14 Jun 2009 16:43:16 +0000 (18:43 +0200)]
Implement -y "force yes" option for hammer utility.

This fixes a problem with terminals when operating remotely via ssh while
using the auto-PFS creation feature of hammer mirror-stream or
hammer mirror-copy.

For more information see the following thread (off-box mirror-stream and
friends):

http://leaf.dragonflybsd.org/mailarchive/users/2009-02/msg00017.html

14 years agotest
Michael Neumann [Sun, 14 Jun 2009 16:18:09 +0000 (18:18 +0200)]
test

14 years agoMADT MP probe: Rework cpuid mapping, and cpuid to apicid mapping
Sepherosa Ziehau [Sun, 14 Jun 2009 11:39:44 +0000 (19:39 +0800)]
MADT MP probe: Rework cpuid mapping, and cpuid to apicid mapping

- Don't use the ACPI ProcessorID as our cpuid, some BIOSes count ProcessorID
  from 1, and ACPI standards actually allow that.  Instead, except for BSP,
  we set the processor's cpuid in the order that we found the MADT LAPIC
  entry.
- Since MADT does not provide a way to identify the BSP, we will have to do
  it ourselves:

  Split the madt_parse() into three parts:
  o  madt_check(), preliminary length and revision check.
  o  madt_pass1(), locate the LAPIC address.
  o  madt_pass2(), set mp_naps and map cpuid to apicid.

  After madt_pass1(), the lapic is mapped, so we could get the current CPU's
  apic id.  Since the current CPU is BSP, we have the BSP's apic id.
  In madt_pass2(), we match the MADT LAPIC entry's apic_id field against the
  the value read from the current CPU's lapic id field.  Any matching means
  that entry contains information concerning BSP.

Reported-by: tuxillo on EFnet #dragonflybsd
14 years agoAHCI - Bug fixes - primary port probe and TFD flushing.
Matthew Dillon [Sun, 14 Jun 2009 06:07:00 +0000 (23:07 -0700)]
AHCI - Bug fixes - primary port probe and TFD flushing.

* The primary port probe was skipping the software reset step.

* ahci_flush_tfd() was looping on the SERR.DIAG.X bit with a 10ms delay,
  but on some parts this bit gets re-set very quickly if the port is
  in a COMRESET state.  Remove the loop, just use an if() instead.

Reported-by: Sepherosa Ziehau
14 years agoAHCI - Implement better timeout semantics, fix bug in error handling, softreset
Matthew Dillon [Sun, 14 Jun 2009 03:27:59 +0000 (20:27 -0700)]
AHCI - Implement better timeout semantics, fix bug in error handling, softreset

* Stopping a port with ahci_port_stop() is problematic if the port has not
  already been stopped by the command processor (CR is inactive), because
  command completions can race our saved CI register, leading to
  double-issues.  This creates issues with both NCQ and FBSS support.

  Change the timeout code to idle the port by allowing commands to
  complete normally until the only commands remaining are expired.
  Then the port can be safely stopped.

  The timeout code also no longer performs a softreset.  It used to under
  certain conditions.

* With the changes to the timeout code softreset is no longer being called
  from the timeout code, remove hacks from the softreset code that attempted
  to restore the command processing state on failure.

* The CAM code was not properly generating dummy SENSE data for command
  timeouts, leading the kernel to believe that the command succeeded
  when it in fact failed.

14 years agoAHCI - Port Multiplier bug fixes
Matthew Dillon [Sat, 13 Jun 2009 21:07:57 +0000 (14:07 -0700)]
AHCI - Port Multiplier bug fixes

* The error ccb must be used in ahci_pm_softreset() to collect a reliable
  signature from the device.

* Release the error ccb before performing any ahci_pm_*() functions (which
  have to issue their own commands).

* Probe the CAM bus asynchronously.

* Proactively assert that the error ccb is not used in a reentrant fashion.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 13 Jun 2009 18:10:06 +0000 (11:10 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoAHCI - fix minor bug in last commit.
Matthew Dillon [Sat, 13 Jun 2009 18:09:50 +0000 (11:09 -0700)]
AHCI - fix minor bug in last commit.

* Fix a broken KKASSERT()

14 years agoAHCI - Fix PM probing issues, wait 10 seconds on physical port insertion
Matthew Dillon [Sat, 13 Jun 2009 17:40:46 +0000 (10:40 -0700)]
AHCI - Fix PM probing issues, wait 10 seconds on physical port insertion

* The spec is not completely clear on the point but CCB[1] *MUST* be used
  as the second CCB in a softreset sequence.  If it isn't, the wrong
  signature may be loaded into the signature register.

* Wait 10 seconds on insertion of a physical port (we already wait 10 seconds
  on the insertion of a target behind a PM).

* Do not cycle the PHY when doing a hard reset, it seems to create
  detection problems.

14 years agoFallback to ACPI MADT CPU enumeration, if BIOS does not provide MP table.
Sepherosa Ziehau [Sat, 13 Jun 2009 12:17:43 +0000 (20:17 +0800)]
Fallback to ACPI MADT CPU enumeration, if BIOS does not provide MP table.

APIC_IO does not work with ACPI MADT CPU enumeration yet.

14 years agoAdd mp_set_cpuids(), which links CPU's logical id to its apic id
Sepherosa Ziehau [Sat, 13 Jun 2009 11:45:43 +0000 (19:45 +0800)]
Add mp_set_cpuids(), which links CPU's logical id to its apic id

14 years agosed(1): Remove the old regression tests.
Sascha Wildner [Sat, 13 Jun 2009 12:05:11 +0000 (14:05 +0200)]
sed(1): Remove the old regression tests.

FreeBSD's tests in tools/regression/usr.bin/sed are more comprehensive.

14 years agosed(1): Sync with FreeBSD.
Sascha Wildner [Sat, 13 Jun 2009 11:39:15 +0000 (13:39 +0200)]
sed(1): Sync with FreeBSD.

* Add workaround for a back reference when no corresponding parenthesized
  subexpression is defined. For example, the following command line caused
  unexpected behavior like segmentation fault:

  % echo test | sed -e 's/test/\1/'

* Fix the code to conform to the "or more" part of the following POSIX
  specification.

  "A function can be preceded by one or more '!' characters, in which
  case the function shall be applied if the addresses do not select
  the pattern space."

* Implement "addr1,+N" ranges - not dissimilar to grep's -A switch.

14 years agoFix several 'cound' typos.
Sascha Wildner [Sat, 13 Jun 2009 10:54:17 +0000 (12:54 +0200)]
Fix several 'cound' typos.

14 years agoImplement ACPI MADT parsing
Sepherosa Ziehau [Sat, 13 Jun 2009 10:41:54 +0000 (18:41 +0800)]
Implement ACPI MADT parsing

This will be used to enumerate CPUs if BIOS does not provide MP table

14 years agoAHCI - fixes to ahci_port_init()
Matthew Dillon [Sat, 13 Jun 2009 07:30:59 +0000 (00:30 -0700)]
AHCI - fixes to ahci_port_init()

* ahci_port_init() had some coding errors related to physical ports verses
  targets behind a port multiplier.  Correct the errors.

* Increase the post-boot insertion delay to 10 seconds.

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

14 years agoAHCI - Port multiplier plug/unplug work, tuning, cleanup, bug fixes.
Matthew Dillon [Sat, 13 Jun 2009 07:02:39 +0000 (00:02 -0700)]
AHCI - Port multiplier plug/unplug work, tuning, cleanup, bug fixes.

* Clean up the command dispatch and polling code, including fixing a
  deadlock between the timeout code and the polling code.  The polling
  code now checks for timed-out CCBs.

* Test some of the delay intervals in the hard and softreset code to
  reduce protocol problems.

* Add an exclusive-access abstraction for dealing with device insertions
  and removals.  This isn't working perfectly yet, there are still some
  communications issues due to the newly inserted device interfering with
  devices already in the enclosure.

* Greatly reduce probe times.

14 years agoACPI P-State probing: Put _PCT evaluation error logging under bootverbose.
Sepherosa Ziehau [Sat, 13 Jun 2009 03:52:37 +0000 (11:52 +0800)]
ACPI P-State probing: Put _PCT evaluation error logging under bootverbose.

14 years agoMP table related static function renaming
Sepherosa Ziehau [Sat, 13 Jun 2009 03:42:38 +0000 (11:42 +0800)]
MP table related static function renaming

14 years agoGet rid of global variable 'boot_cpu_id'
Sepherosa Ziehau [Sat, 13 Jun 2009 03:16:53 +0000 (11:16 +0800)]
Get rid of global variable 'boot_cpu_id'

14 years agoCorrect mptable_pass[12]() function comment
Sepherosa Ziehau [Sat, 13 Jun 2009 02:56:21 +0000 (10:56 +0800)]
Correct mptable_pass[12]() function comment

14 years agoAHCI - Fix a bug in ahci_port_intr() when blockable == 0.
Matthew Dillon [Fri, 12 Jun 2009 23:19:35 +0000 (16:19 -0700)]
AHCI - Fix a bug in ahci_port_intr() when blockable == 0.

* The IS register was not being properly masked for the fall-through.

14 years agoAHCI - Implement parallel port scan and thread each port interrupt.
Matthew Dillon [Fri, 12 Jun 2009 21:45:35 +0000 (14:45 -0700)]
AHCI - Implement parallel port scan and thread each port interrupt.

* Implement a thread helper for each port.  The master interrupt will perform
  all actions which can be done without blocking and will delegate any
  remaining actions (typically error and timeout handling) to the
  port's thread helper.

* The thread helper is responsible for the initial probe.  Thus ALL AHCI
  SATA PORTS WILL NOW PROBE IN PARALLEL!  Instead of 6 ports each taking
  2 seconds to probe we now have 6 ports probing in a total of 2 seconds.

* Multiple port multipliers will probe in parallel, but targets on each
  one have to be iterated.

* The attach code waits for all ports to fully probe and then runs CAM
  attachments serially.  This step goes very quickly since the ports
  have already probed.

* Stalls on one physical port will no longer stall the rest of the ports.
  So, for example, stalls on the port connected to your port multiplier
  will not effect operations on, say, your internal SATA ports.

14 years agoCAM - Add missing protocol for xpt_action_async()
Matthew Dillon [Fri, 12 Jun 2009 16:31:43 +0000 (09:31 -0700)]
CAM - Add missing protocol for xpt_action_async()

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

14 years agoAHCI - follow fixes to CAM
Matthew Dillon [Fri, 12 Jun 2009 15:44:38 +0000 (08:44 -0700)]
AHCI - follow fixes to CAM

* Forgot to commit the CAM changes to use xpt_action_async().