dragonfly.git
4 years agoHAMMER - Add MPSAFE suppor for hammer_vop_read().
Matthew Dillon [Tue, 14 Jul 2009 03:46:45 +0000 (20:46 -0700)]
HAMMER - Add MPSAFE suppor for hammer_vop_read().

This is still a bit of a hack.  If vfs.read_mpsafe is set HAMMER will
run MPSAFE for reads from regular files which are cached in the buffer
cache.  Data which is not cached will fall-back to getting the MP lock.

At the moment enabling this operation will cause atime to not get updated
on fully cached files, because the rest of HAMMER is not MPSAFE yet so I
cannot modify the internal hammer_inode state.

4 years agoMPSAFE - Add read() and write() path MPSAFE support, and more.
Matthew Dillon [Tue, 14 Jul 2009 03:41:30 +0000 (20:41 -0700)]
MPSAFE - Add read() and write() path MPSAFE support, and more.

* Add sysctl vfs.read_mpsafe, vfs.write_mpsafe, and vfs.getattr_mpsafe.
  Only vfs.read_mpsafe is currently implemented, and only for HAMMER
  filesystems.

* read() and write() will now call VOP_READ()/VOP_WRITE() without the
  MP lock if the vnode->v_flag says it is ok to do so.

* read() and write() now serialize reads and writes which depend on the
  file offset stored in the fp, when the concurrent operations share the
  same fp.

* Add vnode flags VMP_READ, VMP_WRITE, VMP_GETATTR.

* Add vnode flag VNOTSEEKABLE indicating that fp->f_offset will never be
  used and no serialization is needed (which e.g. can mess up read()'s
  blocking devices such as ttys).

* Correct bug in FIONREAD related to the data field being too small.

4 years agoCCMS - Correct bug, add #include <sys/spinlock2.h> to kern_ccms.c
Matthew Dillon [Tue, 14 Jul 2009 00:19:09 +0000 (17:19 -0700)]
CCMS - Correct bug, add #include <sys/spinlock2.h> to kern_ccms.c

4 years agoCCMS - bug in last commit, remove #include <sys/spinlock2.h> from ccms.h
Matthew Dillon [Tue, 14 Jul 2009 00:17:21 +0000 (17:17 -0700)]
CCMS - bug in last commit, remove #include <sys/spinlock2.h> from ccms.h

4 years agoNormalize the defines for the vnode flags (non-operational change).
Matthew Dillon [Mon, 13 Jul 2009 23:48:45 +0000 (16:48 -0700)]
Normalize the defines for the vnode flags (non-operational change).

4 years agoCCMS - Make the cache coherency locks MPSAFE.
Matthew Dillon [Mon, 13 Jul 2009 23:44:51 +0000 (16:44 -0700)]
CCMS - Make the cache coherency locks MPSAFE.

4 years agoBUF/BIO - MPSAFE work on core buffer cache routines.
Matthew Dillon [Mon, 13 Jul 2009 22:57:53 +0000 (15:57 -0700)]
BUF/BIO - MPSAFE work on core buffer cache routines.

Do initial MPSAFE work on getblk(), bread(), brelse(), bqrelse(),
biowait(), and friends.  Use get_mplock()/rel_mplock() in areas not
yet converted.

Add a flags argument to findblk() and have it return a locked buffer
cache buffer by default.  Callers may request that the buffer be
locked non-blocking, or that it not be locked at all.

Adjust all callers of findblk() for those cases where an unlocked
buffer is desired to lock and re-check the returned buffer's parameters,
since otherwise it can change out from under the caller whether a critical
section is used or not (for SMP).

4 years agopipe - add required critical section around tsleep_interlock() call.
Matthew Dillon [Mon, 13 Jul 2009 21:11:11 +0000 (14:11 -0700)]
pipe - add required critical section around tsleep_interlock() call.

4 years agobuffer cache - protect bufqueues[] with the bufspin spinlock.
Matthew Dillon [Mon, 13 Jul 2009 20:41:12 +0000 (13:41 -0700)]
buffer cache - protect bufqueues[] with the bufspin spinlock.

4 years agoDocument pmap_qremove() as being MPSAFE.
Matthew Dillon [Mon, 13 Jul 2009 18:39:03 +0000 (11:39 -0700)]
Document pmap_qremove() as being MPSAFE.

4 years agoMake getpbuf(), trypbuf(), and relpbuf() MPSAFE.
Matthew Dillon [Mon, 13 Jul 2009 18:38:09 +0000 (11:38 -0700)]
Make getpbuf(), trypbuf(), and relpbuf() MPSAFE.

4 years agoMake biowait() MPSAFE.
Matthew Dillon [Mon, 13 Jul 2009 18:37:35 +0000 (11:37 -0700)]
Make biowait() MPSAFE.

4 years agobuffer cache - Control all access to the buf red-black trees with vp->v_token
Matthew Dillon [Mon, 13 Jul 2009 17:55:24 +0000 (10:55 -0700)]
buffer cache - Control all access to the buf red-black trees with vp->v_token

Access to the buffer cache's RB trees is now controlled via vp->v_token
instead of a critical section.  We still hold the BGL but this is not
quite as simple as it seems because an interrupt calling biodone() on a
B_INVAL buffer may now potentially block, where as it would not have before.
The buffer is locked.

4 years agolwkt_token - Add ASSERT_LWKT_TOKEN_HELD(token) macro.
Matthew Dillon [Mon, 13 Jul 2009 17:53:03 +0000 (10:53 -0700)]
lwkt_token - Add ASSERT_LWKT_TOKEN_HELD(token) macro.

4 years agobio_track - fix bug in last commit (the negative count assertion was wrong)
Matthew Dillon [Mon, 13 Jul 2009 17:42:34 +0000 (10:42 -0700)]
bio_track - fix bug in last commit (the negative count assertion was wrong)

4 years agoMake operations on struct bio_track MPSAFE.
Matthew Dillon [Mon, 13 Jul 2009 16:30:22 +0000 (09:30 -0700)]
Make operations on struct bio_track MPSAFE.

Use atomic ops to make reference counting and waiting on bio_track structures
MPSAFE.

4 years agovnode - move v_pollinfo.vpi_token to v_token
Matthew Dillon [Mon, 13 Jul 2009 14:57:26 +0000 (07:57 -0700)]
vnode - move v_pollinfo.vpi_token to v_token

* Rename the lwkt_token used for the vnode's v_pollinfo for general use by
  the vnode.  This token will soon be used to lock the buffer cache.

4 years agopipe - fix UP build error.
Matthew Dillon [Mon, 13 Jul 2009 14:40:48 +0000 (07:40 -0700)]
pipe - fix UP build error.

Reported-by: Hasso Tepper <hasso@estpak.ee>
4 years agoSYSPERF - update pipe1, pipe2
Matthew Dillon [Mon, 13 Jul 2009 05:44:08 +0000 (22:44 -0700)]
SYSPERF - update pipe1, pipe2

* pipe1 now does a 1-second timing run.

* pipe2 now does a 2-second timing run, just so it runs just a tad longer.

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 13 Jul 2009 05:24:54 +0000 (22:24 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agopipe - replace use of DELAY() with a better solution, add features.
Matthew Dillon [Mon, 13 Jul 2009 05:14:43 +0000 (22:14 -0700)]
pipe - replace use of DELAY() with a better solution, add features.

* Use the new tsc functions to poll for new read data in a pipe for a short
  period of time on a SMP box.  This greatly increases the odds of a pipe
  writer on one cpu being able to pipeline data to a reader on another cpu
  without having to use an IPI or tsleep/wakeup.

  For the pipe1 test this brings the synchronous communications path
  over a pipe (Awrite, Bread, Bwrite, Aread) down from 7uS to around 2uS.

  For the pipe2 test this value greatly reduces the number of IPIs
  and improves bandwidth by a few hundred megabytes/sec (the old DELAY
  did the same thing so there is no change for the pipe2 test).

* Add sysctl kern.pipe.delay which defaults to 5000 nanoseconds (5uS).
  This is the maximum a pipe reader will wait for additional data before
  falling back to tsleep/wakeup (and related ipis).  pipe_delay may be
  set to 0 to disable the function.  I value of at least 3000 is
  recomended.  Pipelining large buffers efficiently requires a higher value,
  say up to 8000 or so.

* Allow kern.pipe.mpsafe to be set to 2 which adds a predictive wakeup
  when a writer is found to be stalled.  This currently has no significant
  effect on operations due to token collisions.

* Add statistics: kern.pipe.wblocked and kern.pipe.rblocked, counting
  the number of times a pipe blocks in "pipewr" or "piperd".

* Fix MP races in pipe_ioctl().

4 years agoclocks - Add fine-grained spin delay function via TSC
Matthew Dillon [Mon, 13 Jul 2009 05:12:50 +0000 (22:12 -0700)]
clocks - Add fine-grained spin delay function via TSC

Add int64_t target = tsc_get_target(ns) and tsc_test_target(target).
See routines for details.  These functions are available when the system
supports an extremely fine-grained counter such as a TSC and may be used
to generate finely tuned delays.

4 years agolibtelnet: Fix some mis-usage of NULL and raise WARNS to 2.
Sascha Wildner [Mon, 13 Jul 2009 02:41:45 +0000 (04:41 +0200)]
libtelnet: Fix some mis-usage of NULL and raise WARNS to 2.

4 years agoOops! Actually install /usr/libexec/telnetd.
Peter Avalos [Mon, 13 Jul 2009 02:31:54 +0000 (16:31 -1000)]
Oops!  Actually install /usr/libexec/telnetd.

Noticed-by: swildner
4 years agobootpgw: Use err(3).
Peter Avalos [Mon, 13 Jul 2009 02:23:04 +0000 (16:23 -1000)]
bootpgw:  Use err(3).

Obtained-from: FreeBSD

4 years agopipe - Fix piperd/pipewr deadlock in mpsafe case
Matthew Dillon [Mon, 13 Jul 2009 01:37:46 +0000 (18:37 -0700)]
pipe - Fix piperd/pipewr deadlock in mpsafe case

* Fix a bug where piperd and pipewr could be entered simultaniously
  by the reader and writer and neither gets woken up.

* Redo the hysteresis slightly to reduce IPIs even more.

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sun, 12 Jul 2009 23:08:06 +0000 (16:08 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agopipe - Make pipe r/w MPSAFE, add kern.pipe.mpsafe (disabled by default)
Matthew Dillon [Sun, 12 Jul 2009 22:42:43 +0000 (15:42 -0700)]
pipe - Make pipe r/w MPSAFE, add kern.pipe.mpsafe (disabled by default)

* Make pipe_read and pipe_write MPSAFE.

* Add a sysctl kern.pipe.mpsafe which defaults to disabled.  Set to
  1 to test the MPSAFE pipe code.  The expectation is that it will be
  set to 1 for the release.  Currently only pipe_read and pipe_write
  is MPSAFE.

* The new code in mpsafe mode also implements a streaming optimization
  to avoid unnecessary tsleep/wakeup/IPIs.  If the reader and writer
  are operating on different cpus this feature results in more uniform
  performance across a wide swath of block sizes.

* The new code currently does not use any page mapping optimizations.
  Page table overhead is fairly nasty on SMP so for now we rely on cpu
  caches and do an extra copy.  This means the code is tuned better for
  more recent cpus and tuned worse for older cpus.  At least for now.

OLD pipe code:  dwe = dwrite_enable, sfb = dwrite_sfbuf mode
NEW pipe code:  mpsafe = 0 (gets bgl) or 1 (does not use bgl)

Using /usr/src/test/sysperf/pipe2.c to test, all results in MBytes/sec

  8K  16K  32K  64K 128K 256K
---- ---- ---- ---- ---- ----
OLD dwe=0 1193 1167 1555 1525 1473 1477
OLD dwe=1 sfb=0  856    1458 2307 2182 2275 2307
OLD dwe=1 sfb=1  955 1537 2300 2356 2363 2708
OLD dwe=1 sfb=2  939 1561 2367 2477 2379 2360

NEW mpsafe=0 1150 1369 1536 1591 1358 1270
NEW mpsafe=1 2133 2319 2375 2387 2396 2418

4 years agopriv: Finally get completely rid of PRISON_ROOT flag.
Michael Neumann [Sun, 12 Jul 2009 22:38:20 +0000 (00:38 +0200)]
priv: Finally get completely rid of PRISON_ROOT flag.

This means that from now on, what is allowed within a jail
is purely defined in function prison_priv_check().

4 years agopriv: Define and use PRIV_PROC_TRESPASS
Michael Neumann [Sun, 12 Jul 2009 22:35:39 +0000 (00:35 +0200)]
priv: Define and use PRIV_PROC_TRESPASS

4 years agopriv: Define and use PRIV_SETHOSTNAME
Michael Neumann [Sun, 12 Jul 2009 22:16:27 +0000 (00:16 +0200)]
priv: Define and use PRIV_SETHOSTNAME

4 years agopriv: Define and use PRIV_VARSYM_SYS
Michael Neumann [Sun, 12 Jul 2009 22:08:56 +0000 (00:08 +0200)]
priv: Define and use PRIV_VARSYM_SYS

4 years agoSimplify expressions
Michael Neumann [Sun, 12 Jul 2009 22:01:43 +0000 (00:01 +0200)]
Simplify expressions

4 years agopriv: Define and use PRIV_HAMMER_IOCTL
Michael Neumann [Sun, 12 Jul 2009 21:48:14 +0000 (23:48 +0200)]
priv: Define and use PRIV_HAMMER_IOCTL

4 years agopriv: Use PRIV_DEBUG_UNPRIV in procfs
Michael Neumann [Sun, 12 Jul 2009 21:46:10 +0000 (23:46 +0200)]
priv: Use PRIV_DEBUG_UNPRIV in procfs

4 years agopriv: Use PRIV_VFS_SETGID
Michael Neumann [Sun, 12 Jul 2009 21:16:57 +0000 (23:16 +0200)]
priv: Use PRIV_VFS_SETGID

Note that in case of UFS, the priv_cred_check() call will now
succeed in a jail, whereas it failed before.

4 years agopriv: Sync ext2_quotactl() with ufs_quotactl() implementation
Michael Neumann [Sun, 12 Jul 2009 20:59:09 +0000 (22:59 +0200)]
priv: Sync ext2_quotactl() with ufs_quotactl() implementation

4 years agopriv: Use PRIV_VFS_CHMOD and PRIV_VFS_CHOWN
Michael Neumann [Sun, 12 Jul 2009 20:54:05 +0000 (22:54 +0200)]
priv: Use PRIV_VFS_CHMOD and PRIV_VFS_CHOWN

4 years agomath.3: Mention f{max,min,dim}.
Stathis Kamperis [Sun, 12 Jul 2009 20:06:23 +0000 (23:06 +0300)]
math.3: Mention f{max,min,dim}.

4 years agolibm: Import fdim{,f,l} functions from FreeBSD.
Stathis Kamperis [Mon, 1 Jun 2009 10:31:11 +0000 (13:31 +0300)]
libm: Import fdim{,f,l} functions from FreeBSD.

4 years agolibm: Import fmax{,f,l} and fmin{,f,l} functions from FreeBSD.
Stathis Kamperis [Sun, 31 May 2009 20:35:54 +0000 (23:35 +0300)]
libm: Import fmax{,f,l} and fmin{,f,l} functions from FreeBSD.

4 years agopriv: Refactor UFS quota permissions
Michael Neumann [Sun, 12 Jul 2009 17:58:16 +0000 (19:58 +0200)]
priv: Refactor UFS quota permissions

4 years agoRemove duplicate line
Michael Neumann [Sun, 12 Jul 2009 17:34:44 +0000 (19:34 +0200)]
Remove duplicate line

4 years agopriv: Use PRIV_VFS_CHMOD and PRIV_VFS_CHOWN
Michael Neumann [Sun, 12 Jul 2009 17:30:58 +0000 (19:30 +0200)]
priv: Use PRIV_VFS_CHMOD and PRIV_VFS_CHOWN

4 years agopriv: Introduce and use PRIV_VFS_SETATTR in xxx_setattr()
Michael Neumann [Sun, 12 Jul 2009 17:20:09 +0000 (19:20 +0200)]
priv: Introduce and use PRIV_VFS_SETATTR in xxx_setattr()

Replace PRIV_ROOT, PRISON_ROOT combination in xxx_setattr() function
(e.g. ext2fs_setattr()) of several filesystems with PRIV_VFS_SETATTR.

4 years agopriv: Use PRIV_NETINET_RAW
Michael Neumann [Sun, 12 Jul 2009 16:51:29 +0000 (18:51 +0200)]
priv: Use PRIV_NETINET_RAW

4 years agopriv: Use PRIV_NETINET_RESERVEDPORT
Michael Neumann [Sun, 12 Jul 2009 16:48:07 +0000 (18:48 +0200)]
priv: Use PRIV_NETINET_RESERVEDPORT

4 years agopriv: Use PRIV_NETINET_RESERVEDPORT
Michael Neumann [Sun, 12 Jul 2009 16:33:52 +0000 (18:33 +0200)]
priv: Use PRIV_NETINET_RESERVEDPORT

4 years agopriv: Comment PRIV_NETINET_RAW as FreeBSD does
Michael Neumann [Sun, 12 Jul 2009 16:29:33 +0000 (18:29 +0200)]
priv: Comment PRIV_NETINET_RAW as FreeBSD does

4 years agopriv: Use PRIV_NETINET_RAW
Michael Neumann [Sun, 12 Jul 2009 16:17:46 +0000 (18:17 +0200)]
priv: Use PRIV_NETINET_RAW

4 years agopriv: Introduce and use PRIV_VFS_REVOKE
Michael Neumann [Sun, 12 Jul 2009 16:07:12 +0000 (18:07 +0200)]
priv: Introduce and use PRIV_VFS_REVOKE

4 years agopriv: Use PRIV_VFS_CHFLAGS_DEV
Michael Neumann [Sun, 12 Jul 2009 15:59:42 +0000 (17:59 +0200)]
priv: Use PRIV_VFS_CHFLAGS_DEV

4 years agopriv: Use PRIV_VFS_LINK
Michael Neumann [Sun, 12 Jul 2009 15:53:06 +0000 (17:53 +0200)]
priv: Use PRIV_VFS_LINK

4 years agopriv: Introduce and use PRIV_VFS_CHMOD
Michael Neumann [Sun, 12 Jul 2009 15:44:23 +0000 (17:44 +0200)]
priv: Introduce and use PRIV_VFS_CHMOD

4 years agopriv: Remove some uses of PRIV_ROOT/PRISON_ROOT
Michael Neumann [Sun, 12 Jul 2009 14:55:15 +0000 (16:55 +0200)]
priv: Remove some uses of PRIV_ROOT/PRISON_ROOT

4 years agokmod.mk: Remove some dead code supposed to handle modules' manual pages.
Sascha Wildner [Sun, 12 Jul 2009 04:40:19 +0000 (06:40 +0200)]
kmod.mk: Remove some dead code supposed to handle modules' manual pages.

It was ignored previously and since we do not keep kernel related
manual pages in sys/ the whole idea is bogus anyway.

4 years agoRemove crunchgen(8).
Sascha Wildner [Sun, 12 Jul 2009 01:34:57 +0000 (03:34 +0200)]
Remove crunchgen(8).

4 years agoMerge branch 'master' of /home/www-data/gitweb/dragonfly
Peter Avalos [Sun, 12 Jul 2009 10:08:55 +0000 (00:08 -1000)]
Merge branch 'master' of /home/www-data/gitweb/dragonfly

4 years agopipe - pre-MP work, change indexing to circular FIFO rindex/windex.
Matthew Dillon [Sun, 12 Jul 2009 05:34:40 +0000 (22:34 -0700)]
pipe - pre-MP work, change indexing to circular FIFO rindex/windex.

4 years agoDocument various get-time functions and vfs_timestamp() as MPSAFE.
Matthew Dillon [Sun, 12 Jul 2009 03:45:52 +0000 (20:45 -0700)]
Document various get-time functions and vfs_timestamp() as MPSAFE.

4 years agopipe - pre-MP work, remove direct map and sfbuf features
Matthew Dillon [Sun, 12 Jul 2009 02:14:23 +0000 (19:14 -0700)]
pipe - pre-MP work, remove direct map and sfbuf features

To help with the initial MPSAFE work we are removing the direct-write
optimizations.  This represents a slight nerf on a SMP box on a modern
cpu, but not really enough to matter in the grand scheme of things.
They may return at some future date.

4 years agoStop building multiple versions of telnet.
Peter Avalos [Sun, 12 Jul 2009 01:50:58 +0000 (15:50 -1000)]
Stop building multiple versions of telnet.

It's ok to move this code outside of crypto/ because it doesn't actually
contain any crypto -- only routines that call the crypto functions.
This keeps the code centralized, and the usual make.conf defines will
control what gets built (the default is still non-kerberos and with
crypto).

4 years agogetdevpath.[38]: mdoc cleanup
Sascha Wildner [Sat, 11 Jul 2009 23:43:15 +0000 (01:43 +0200)]
getdevpath.[38]: mdoc cleanup

4 years agovrevoke/single-user - fix more revoke issues.
Matthew Dillon [Sat, 11 Jul 2009 22:56:25 +0000 (15:56 -0700)]
vrevoke/single-user - fix more revoke issues.

* vrevoke() no longer clears vp->v_rdev.  Doing so interferes with specfs's
  ability to call dev_dclose().  Fixing this will allow the regular close
  of the vnode to close the underlying device.

  Since the revoke code detaches the vnode from any user-visible file
  descriptors the vnode will end up being closed the moment the last
  referenced to the detached fp goes away.

* kill 1 no longer leaves the syscons in a state where both /dev/ttyv0 and
  /dev/console are marked open (due to the above bug).  This state would
  cause the keyboard to stop working sometimes when dropping into single
  user.

* Add dev_drevoke() and friends.  This allows a device to do something
  when an attempt is made to revoke() the related vnode.

  TTY and PTY devices now attempt to break out of any ttysleep() operation
  (such as when processes are blocked in read()).  This is advisory and
  if it fails to break a process out of a blocked condition that process
  will still detach after the blocked condition is resolved normally.

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 11 Jul 2009 15:25:03 +0000 (08:25 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agogetdevpath - add _PATH_DEVTAB_PATHS
Matthew Dillon [Sat, 11 Jul 2009 15:22:02 +0000 (08:22 -0700)]
getdevpath - add _PATH_DEVTAB_PATHS

Reminded-by: Sascha Wildner <saw@online.de>
4 years agoGet rid of PCI_MAP_FIXUP and opt_pci.h
Sepherosa Ziehau [Sat, 11 Jul 2009 08:21:17 +0000 (16:21 +0800)]
Get rid of PCI_MAP_FIXUP and opt_pci.h

4 years agoACPI: Make acpi_pci* compile; they are not used yet.
Alexander Polakov [Tue, 9 Jun 2009 08:59:33 +0000 (12:59 +0400)]
ACPI: Make acpi_pci* compile; they are not used yet.

Submitted-by: Alexander Polakov <polachok@gmail.com> w/ modification
4 years agoamd64: Copy MPTable PCI interrput routing code from i386
Sepherosa Ziehau [Fri, 10 Jul 2009 11:12:51 +0000 (19:12 +0800)]
amd64: Copy MPTable PCI interrput routing code from i386

Following three commits on i386 are merged:
eaec4152c00f8d7503f218f2a246802044d2600e
566f2cdcd40f5829aedb2c0b2a8339e189c7570d
6fd2232c44c5937a832a5b929989de0b1ddfc9de

4 years agoMPTable PCI interrupt routing: Verbose logging if an ISA IRQ is to be tried.
Sepherosa Ziehau [Fri, 10 Jul 2009 08:10:08 +0000 (16:10 +0800)]
MPTable PCI interrupt routing: Verbose logging if an ISA IRQ is to be tried.

4 years agoUse same interrupt vector handler for fast/slow interrupt handlers
Sepherosa Ziehau [Fri, 10 Jul 2009 07:29:24 +0000 (15:29 +0800)]
Use same interrupt vector handler for fast/slow interrupt handlers

Slow interrupt vector handler is removed.  Fast interrupt vector handler,
ithread_fast_handler(), now schedules slow interrupt handlers if necessary:
o  No fast interrupt handlers are registered
o  Mixed fast and slow interrpt handlers are registered
o  Non-MPSAFE fast interrupt handlers could not get BGL

i386/amd64: gd_ipending field in mdglobaldata is revoked, which is only
used by slow interrupt vector handler.

ithread_fast_handler()'s invoking convetion is changed:
- ithead_fast_handler() must be called with critical section being held
- Callers of ithead_fast_handler() no longer bump gd_intr_nesting_level

Discussed-with: dillon@
Reviewed-by: dillon@
4 years agopci: Add MPTable Host-PCI/PCI-PCI bridges drivers.
Sepherosa Ziehau [Thu, 9 Jul 2009 14:06:54 +0000 (22:06 +0800)]
pci: Add MPTable Host-PCI/PCI-PCI bridges drivers.

- This driver overrides PCI bridge interrupt routing method.
- Nuke APIC_IO workaround in PCI configuration reading functions.

Obtained-from: FreeBSD

4 years agoIO APIC: Assign pins dedicated to PCI in the early stage.
Sepherosa Ziehau [Thu, 9 Jul 2009 09:09:21 +0000 (17:09 +0800)]
IO APIC: Assign pins dedicated to PCI in the early stage.

After this, we no longer need to reprogramme IO APIC every time
an interrupt handler is to be registered, which is potentially
dangerous.

4 years agoACPI MADT: Hide debug prints under bootverbose
Sepherosa Ziehau [Thu, 9 Jul 2009 06:33:45 +0000 (14:33 +0800)]
ACPI MADT: Hide debug prints under bootverbose

4 years agoRemove unused code in pc32/ipl.s
Sepherosa Ziehau [Thu, 9 Jul 2009 05:06:19 +0000 (13:06 +0800)]
Remove unused code in pc32/ipl.s

4 years agoRemove unused code in pc32/apic_vector.s
Sepherosa Ziehau [Thu, 9 Jul 2009 04:11:00 +0000 (12:11 +0800)]
Remove unused code in pc32/apic_vector.s

4 years agoIO APIC: Get rid of apic_imen
Sepherosa Ziehau [Thu, 9 Jul 2009 02:15:34 +0000 (10:15 +0800)]
IO APIC: Get rid of apic_imen

Add IOAPIC_IM_FLAG_MASKED to apic_intmapinfo, which indicates the
IRQ is currently masked.  Use it instead of apic_imen.

4 years agoIO APIC: Get rid of apic_pin_trigger
Sepherosa Ziehau [Wed, 8 Jul 2009 09:08:53 +0000 (17:08 +0800)]
IO APIC: Get rid of apic_pin_trigger

- Expend apic_intmapinfo from 16bytes to 32bytes
- Add flags field in apic_intmapinfo, which now records irq's trigger mode

4 years agoUse genassym to replace magic numbers in pc32/apic_{vector,ipl}.s
Sepherosa Ziehau [Wed, 8 Jul 2009 08:30:00 +0000 (16:30 +0800)]
Use genassym to replace magic numbers in pc32/apic_{vector,ipl}.s

4 years agoAPIC vector: Compact redirect entry's mask bit setting and clearing
Sepherosa Ziehau [Wed, 8 Jul 2009 06:53:37 +0000 (14:53 +0800)]
APIC vector: Compact redirect entry's mask bit setting and clearing

4 years agoUse IOAPIC_WINDOW in pc32/apic_ipl.s
Sepherosa Ziehau [Wed, 8 Jul 2009 06:32:41 +0000 (14:32 +0800)]
Use IOAPIC_WINDOW in pc32/apic_ipl.s

4 years agoRemove unused code in pc32/ipl.s
Sepherosa Ziehau [Wed, 8 Jul 2009 03:40:01 +0000 (11:40 +0800)]
Remove unused code in pc32/ipl.s

4 years agoRemove unsued code in kern/kern_intr.c
Sepherosa Ziehau [Wed, 8 Jul 2009 03:35:07 +0000 (11:35 +0800)]
Remove unsued code in kern/kern_intr.c

4 years agofast intr: Don't dispatch to the BGL owner, if BGL could not be holden;
Sepherosa Ziehau [Wed, 8 Jul 2009 03:29:44 +0000 (11:29 +0800)]
fast intr: Don't dispatch to the BGL owner, if BGL could not be holden;
just reschedule ithread.

Discussed-with: dillon@

4 years agoMove to the interrupt's destination CPU before tearing down the interrupt
Sepherosa Ziehau [Wed, 8 Jul 2009 03:08:01 +0000 (11:08 +0800)]
Move to the interrupt's destination CPU before tearing down the interrupt

4 years agoTurn on PG_N (nocache) when mapping ioapic
Sepherosa Ziehau [Wed, 8 Jul 2009 02:32:41 +0000 (10:32 +0800)]
Turn on PG_N (nocache) when mapping ioapic

Noticed-by: Jordan Gordeev <jgordeev@dir.bg>
4 years agoprocfs - fix incremental reads of /proc/*/rlimit
Matthew Dillon [Fri, 10 Jul 2009 22:24:08 +0000 (15:24 -0700)]
procfs - fix incremental reads of /proc/*/rlimit

The rlimit code was only properly copying data for all-in-one-go reads,
and mishandling incremental reads.

Submitted-by: Beket@@irc
4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 10 Jul 2009 21:09:50 +0000 (14:09 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agoAdd /sbin/getdevpath utility - userland convenience utility for getdevpath(3).
Matthew Dillon [Fri, 10 Jul 2009 21:09:13 +0000 (14:09 -0700)]
Add /sbin/getdevpath utility - userland convenience utility for getdevpath(3).

4 years agolibutil - add getdevpath()
Matthew Dillon [Fri, 10 Jul 2009 20:56:56 +0000 (13:56 -0700)]
libutil - add getdevpath()

Add the getdevpath() function which translates a device name such as "da0",
or label such as "fubar", into a device path.  This function searches
/usr/local/etc/devtab, /etc/devtab, and /etc/defaults/devtab for labels.
Device names beginning with '/' or '.' are assumed to be paths and passed
through.

4 years agopthread_once.3: Fix typo.
Sascha Wildner [Fri, 10 Jul 2009 02:33:50 +0000 (04:33 +0200)]
pthread_once.3: Fix typo.

4 years agopthread_barrierattr.3: Remove empty section.
Sascha Wildner [Fri, 10 Jul 2009 02:25:21 +0000 (04:25 +0200)]
pthread_barrierattr.3: Remove empty section.

4 years agosigwait.3: Add missing '.'
Sascha Wildner [Fri, 10 Jul 2009 02:17:38 +0000 (04:17 +0200)]
sigwait.3: Add missing '.'

4 years agopthread*.3: Sync the pthread manpages with FreeBSD.
Sascha Wildner [Fri, 10 Jul 2009 02:16:40 +0000 (04:16 +0200)]
pthread*.3: Sync the pthread manpages with FreeBSD.

Brings in some missing pages and some small fixes.

Reminded-by: hasso
4 years agopci.9: Sync with FreeBSD.
Sascha Wildner [Thu, 9 Jul 2009 21:29:21 +0000 (23:29 +0200)]
pci.9: Sync with FreeBSD.

4 years agoamd64: Sync header 'int_limits.h' with i386.
Jordan Gordeev [Thu, 9 Jul 2009 11:07:59 +0000 (14:07 +0300)]
amd64: Sync header 'int_limits.h' with i386.
Helps building of GNU m4 (and other GNU stuff).

4 years agoRemove obsolete kernel options: PCI_ENABLE_IO_MODES & PCI_QUIET.
Sascha Wildner [Thu, 9 Jul 2009 07:58:05 +0000 (09:58 +0200)]
Remove obsolete kernel options: PCI_ENABLE_IO_MODES & PCI_QUIET.

4 years agoRemove hardcoded -g in several Makefiles.
Sascha Wildner [Wed, 8 Jul 2009 20:43:21 +0000 (22:43 +0200)]
Remove hardcoded -g in several Makefiles.

4 years agoCAM - disable cache synchronization by default for USB attachments.
Matthew Dillon [Thu, 9 Jul 2009 03:01:17 +0000 (20:01 -0700)]
CAM - disable cache synchronization by default for USB attachments.

Instead of trying to blacklist particular usb mass storage devices which
do not support the cache synchronization command, just default to not
supporting it for ALL usb mass storage attachments.  Too many usb devices
brick when sent the command.

It matters more now that people are using HAMMER, and HAMMER utilizes the
cache synchronization command to delineate flushes.  We will now by
definition not be able to guarantee recovery if HAMMER is used on a USB
mass storage device.  It will probably work anyway, though.

Reported-by: Many people
4 years agoAMD64 - Fix identcpu.
Matthew Dillon [Wed, 8 Jul 2009 21:03:28 +0000 (14:03 -0700)]
AMD64 - Fix identcpu.