]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoFix build.
ru [Tue, 25 Mar 2008 13:20:52 +0000 (13:20 +0000)]
Fix build.

Reported by: ache, tinderbox

16 years agoAdd /boot/device.hints to the list of files which will have local
cperciva [Tue, 25 Mar 2008 12:13:12 +0000 (12:13 +0000)]
Add /boot/device.hints to the list of files which will have local
modifications merged.  I had initially expected that people would
put any local changes into /boot/loader.conf, but it turns out that
editing /boot/device.hints is something many people do.

Suggested by: Jaakko Heinonen
MFC after: 1 week

16 years agoAdjust recognize-shared-libraries regex to avoid matching symlinks to
cperciva [Tue, 25 Mar 2008 11:31:16 +0000 (11:31 +0000)]
Adjust recognize-shared-libraries regex to avoid matching symlinks to
shared libraries.

This fixes a problem which resulted in 6.x->7.x upgrades having the
/usr/lib/libpthread.so -> libthr.so symlink missing; what happened was
that the old libpthread.so symlink pointed to /lib/libpthread.so.2 --
which matched the "/lib/*\.so\.[0-9]+" regex -- but the new symlink
didn't, so FreeBSD Update got confused and deleted the symlink as part
of its "remove old shared libraries" step.

To recreate the symlink (which I understand is necessary for ports like
KDE to build) on a 7.x system which FreeBSD Update upgraded from 6.x:
# ln -s libthr.so /usr/lib/libpthread.so

Reported by: Dmitry RCL Rekman
Help diagnosing bug from: kris
MFC after: 7 days

16 years agoFixed mis-implementation of pthread_mutex_get{spin,yield}loops_np().
ru [Tue, 25 Mar 2008 09:48:10 +0000 (09:48 +0000)]
Fixed mis-implementation of pthread_mutex_get{spin,yield}loops_np().

Reviewed by: davidxu

16 years agoReplaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.
ru [Tue, 25 Mar 2008 09:39:02 +0000 (09:39 +0000)]
Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.
Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true
since the advent of MBUMA.

Reviewed by: arch

There are ongoing disputes as to whether we want to switch to directly using
UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation.

16 years agoRegen after changing prototypes of cpuset_{get,set}affinity().
ru [Tue, 25 Mar 2008 09:14:17 +0000 (09:14 +0000)]
Regen after changing prototypes of  cpuset_{get,set}affinity().

16 years agoFixed type of the fourth argument of cpuset_{get,set}affinity(2) to be size_t.
ru [Tue, 25 Mar 2008 09:11:53 +0000 (09:11 +0000)]
Fixed type of the fourth argument of cpuset_{get,set}affinity(2) to be size_t.

Prodded by: davidxu

16 years agoCheck for a NULL free buffer pointer in BPF before invoking
rwatson [Tue, 25 Mar 2008 07:41:33 +0000 (07:41 +0000)]
Check for a NULL free buffer pointer in BPF before invoking
bpf_canfreebuf() in order to avoid potentially calling a non-inlinable
but trivial function in zero-copy buffer mode for every packet
received when we couldn't free the buffer anyway.

MFC after: 4 months

16 years agoAdd support for Marvell Libertas 88W8335 based PCI network adapters.
weongyo [Tue, 25 Mar 2008 06:32:33 +0000 (06:32 +0000)]
Add support for Marvell Libertas 88W8335 based PCI network adapters.

Reviewed by: sam, many wireless people
Approved by: thompsa (mentor)

16 years agoFix double patch on this file.
edwin [Tue, 25 Mar 2008 03:04:54 +0000 (03:04 +0000)]
Fix double patch on this file.

16 years agoMFV of tzdata2008a
edwin [Tue, 25 Mar 2008 02:56:25 +0000 (02:56 +0000)]
MFV of tzdata2008a

Changes:
- Calcutta -> Kolkata
- Iraq DST changes
- Syria DST changes
- Saigon -> Ho_Chi_Minh
- Cuba DST changes
- New area America/Argentina/San_Luis

Approved by: grog@ (mentor)

16 years agoSpell "blackhole" correctly and fix one grammar nit.
ru [Mon, 24 Mar 2008 22:57:55 +0000 (22:57 +0000)]
Spell "blackhole" correctly and fix one grammar nit.

16 years agoRewrite node to support multiple hooks, alike to ng_l2tp, to use one pair
mav [Mon, 24 Mar 2008 22:55:22 +0000 (22:55 +0000)]
Rewrite node to support multiple hooks, alike to ng_l2tp, to use one pair
of pptpgre and ksocket nodes for all calls between two peers. This patch
modifies node's API by adding new "session_%04x" hook names support, while
keeping backward compatibility.

Together with appropriate user-level support (by latest mpd5) it gives
huge performance benefits for case of multiple active calls between
two peers because of avoiding data duplication and extra socket processing.
On my benchmarks I have got more then 10 times speedup for the 200
simultaneous PPTP calls between two peers.
In conclusion, it allows now to build effective "clients <=> PAC <=> PNS"
setups.

16 years agoBelatedly add BPF_JITTER in NOTES for supported architectures.
jkim [Mon, 24 Mar 2008 22:23:22 +0000 (22:23 +0000)]
Belatedly add BPF_JITTER in NOTES for supported architectures.

16 years agoFix build with option BPF_JITTER.
jkim [Mon, 24 Mar 2008 22:21:32 +0000 (22:21 +0000)]
Fix build with option BPF_JITTER.

16 years agoRemove redundant inclusions of net/bpfdesc.h.
jkim [Mon, 24 Mar 2008 22:16:46 +0000 (22:16 +0000)]
Remove redundant inclusions of net/bpfdesc.h.

16 years agoThis commit was generated by cvs2svn to compensate for changes in r177580,
sam [Mon, 24 Mar 2008 21:20:35 +0000 (21:20 +0000)]
This commit was generated by cvs2svn to compensate for changes in r177580,
which included commits to RCS files with non-trunk default branches.

16 years agoadd support for driver-based RADIUS ACL's (committed on vendor branch as it's
sam [Mon, 24 Mar 2008 21:20:35 +0000 (21:20 +0000)]
add support for driver-based RADIUS ACL's (committed on vendor branch as it's
been sent upstream)

Submitted by: Chris Zimmermann

16 years agoresolve merge conflicts
sam [Mon, 24 Mar 2008 21:08:25 +0000 (21:08 +0000)]
resolve merge conflicts

MFC after: 3 weeks

16 years agoImport of hostapd 0.5.10
sam [Mon, 24 Mar 2008 21:06:16 +0000 (21:06 +0000)]
Import of hostapd 0.5.10

16 years agoThis commit was generated by cvs2svn to compensate for changes in r177576,
sam [Mon, 24 Mar 2008 21:06:16 +0000 (21:06 +0000)]
This commit was generated by cvs2svn to compensate for changes in r177576,
which included commits to RCS files with non-trunk default branches.

16 years agochange inp_wlock_assert to inp_lock_assert
kmacy [Mon, 24 Mar 2008 20:24:04 +0000 (20:24 +0000)]
change inp_wlock_assert to inp_lock_assert

16 years agoenable syslog support and add -s option to the man page
sam [Mon, 24 Mar 2008 20:19:20 +0000 (20:19 +0000)]
enable syslog support and add -s option to the man page

MFC after: 3 weeks

16 years agoThis commit was generated by cvs2svn to compensate for changes in r177572,
sam [Mon, 24 Mar 2008 20:13:41 +0000 (20:13 +0000)]
This commit was generated by cvs2svn to compensate for changes in r177572,
which included commits to RCS files with non-trunk default branches.

16 years agoadd syslog support (committed on vendor branch as it's been sent upstream)
sam [Mon, 24 Mar 2008 20:13:41 +0000 (20:13 +0000)]
add syslog support (committed on vendor branch as it's been sent upstream)

PR: bin/116190

16 years agoupdate for 0.5.10
sam [Mon, 24 Mar 2008 19:59:12 +0000 (19:59 +0000)]
update for 0.5.10

16 years agoresolve merge conflicts
sam [Mon, 24 Mar 2008 19:57:51 +0000 (19:57 +0000)]
resolve merge conflicts

MFC after: 3 weeks

16 years agoImport of WPA supplicant 0.5.10
sam [Mon, 24 Mar 2008 19:46:53 +0000 (19:46 +0000)]
Import of WPA supplicant 0.5.10

16 years agoThis commit was generated by cvs2svn to compensate for changes in r177568,
sam [Mon, 24 Mar 2008 19:46:53 +0000 (19:46 +0000)]
This commit was generated by cvs2svn to compensate for changes in r177568,
which included commits to RCS files with non-trunk default branches.

16 years agoDiff reduction to Adaptec's driver (around build 15317): catch up with a
emaste [Mon, 24 Mar 2008 19:23:33 +0000 (19:23 +0000)]
Diff reduction to Adaptec's driver (around build 15317): catch up with a
change in debugging routines.

The fwprintf macro in the AAC_DEBUG case (mapping to printf) isn't from the
Adaptec driver.

16 years agoo add M_PROTO[678]; they'll be needed by net80211 vap code
sam [Mon, 24 Mar 2008 19:01:29 +0000 (19:01 +0000)]
o add M_PROTO[678]; they'll be needed by net80211 vap code
o sort mbuf flags together and extend values to 32 bits
o write M_COPYFLAGS in terms of M_PROTOFLAGS
o move M_COPYFLAGS and M_PROTOFLAGS up to be together with flag defs

Reviewed by: rwatson
MFC after: 3 weeks

16 years ago- Const'ify the bus_stream_asi and bus_type_asi arrays.
marius [Mon, 24 Mar 2008 17:57:01 +0000 (17:57 +0000)]
- Const'ify the bus_stream_asi and bus_type_asi arrays.
- Replace hard-coded functions names missed in bus_machdep.c rev. 1.44
  with __func__.
- Break some long lines.

MFC after: 1 month

16 years ago- Take advantage of bus_dmamap_load_mbuf_sg(9).
marius [Mon, 24 Mar 2008 17:49:06 +0000 (17:49 +0000)]
- Take advantage of bus_dmamap_load_mbuf_sg(9).
- Take advantage of m_collapse(9).
- Sync with other NIC drivers and prepend a TX mbuf if the first attempt
  to load it fails with an error other than EFBIG and stop trying instead
  of freeing it and keeping on trying to enqueue more mbufs. Also ensure
  the driver queue isn't empty before trying to enqueue mbufs in order to
  reduce locking operations.
- In xl_ifmedia_upd() add a missing XL_UNLOCK(). [1]
- Const'ify the xl_devs array.
- Remove an outdated comment.

PR: 113406 [1]
MFC after: 1 month

16 years ago- Const'ify the dc_devs array.
marius [Mon, 24 Mar 2008 17:38:24 +0000 (17:38 +0000)]
- Const'ify the dc_devs array.
- Correct the maxsize parameter when creating the mbufs busdma tag to
  reflect the actual requirement of dc(4).
- Move the KASSERT in dc_newbuf() to the right spot.
- Also convert the TX side to take advantage of bus_dmamap_load_mbuf_sg(9).
- Move the comment regarding dc_start_locked() to the right spot.

MFC after: 2 weeks

16 years agoSplit the registers into two halves in preparation for SBus support.
marius [Mon, 24 Mar 2008 17:23:53 +0000 (17:23 +0000)]
Split the registers into two halves in preparation for SBus support.

Obtained from: NetBSD (loosely)
MFC after: 2 weeks

16 years agoDiff reduction to Adaptec driver build 15317 (refactoring and code shuffling):
emaste [Mon, 24 Mar 2008 16:38:47 +0000 (16:38 +0000)]
Diff reduction to Adaptec driver build 15317 (refactoring and code shuffling):

- Resource allocation in aac_alloc (moved from from aac_init)
- Interrupt setup in aac_setup_intr (from aac_attach)
- Container probing in aac_get_container_info (from aac_startup and
  aac_handle_aif)
- Firmware status check moved to aac_check_firmware from aac_init

16 years agoFix a bug that when getting/dumping the soft lifetime we reported
bz [Mon, 24 Mar 2008 15:01:20 +0000 (15:01 +0000)]
Fix a bug that when getting/dumping the soft lifetime we reported
the hard lifetime instead.

MFC after: 3 days

16 years agoImport change from KAME, rev. 1.362 kame/kame/sys/netkey/key.c
bz [Mon, 24 Mar 2008 14:55:09 +0000 (14:55 +0000)]
Import change from KAME, rev. 1.362 kame/kame/sys/netkey/key.c

In case of "new SA", we must check the hard lifetime of the old SA
to find out if it is not permanent and we can delete it.

Submitted by: sakane via gnn
MFC after: 3 days

16 years agoDon't remove usr/include/fs/nwfs and usr/include/netncp, as they are always
antoine [Mon, 24 Mar 2008 14:46:40 +0000 (14:46 +0000)]
Don't remove usr/include/fs/nwfs and usr/include/netncp, as they are always
recreated during installworld (they are in BSD.include.dist).

Reported by: Pawel Worach
Approved by: rwatson (mentor)
X-MFC: with revision 1.13

16 years agoBump the FreeBSD version for zerocopy bpf buffers and changes to the
csjp [Mon, 24 Mar 2008 14:30:01 +0000 (14:30 +0000)]
Bump the FreeBSD version for zerocopy bpf buffers and changes to the
bpf(4) monitoring ABI/structures.

16 years agoCatch netstat up for the new bpf stats structures. Print 64 bit values
csjp [Mon, 24 Mar 2008 13:50:39 +0000 (13:50 +0000)]
Catch netstat up for the new bpf stats structures.  Print 64 bit values
properly.

Sponsored by: Seccuris Inc
MFC after: 4 months

16 years agoIntroduce support for zero-copy BPF buffering, which reduces the
csjp [Mon, 24 Mar 2008 13:49:17 +0000 (13:49 +0000)]
Introduce support for zero-copy BPF buffering, which reduces the
overhead of packet capture by allowing a user process to directly "loan"
buffer memory to the kernel rather than using read(2) to explicitly copy
data from kernel address space.

The user process will issue new BPF ioctls to set the shared memory
buffer mode and provide pointers to buffers and their size. The kernel
then wires and maps the pages into kernel address space using sf_buf(9),
which on supporting architectures will use the direct map region. The
current "buffered" access mode remains the default, and support for
zero-copy buffers must, for the time being, be explicitly enabled using
a sysctl for the kernel to accept requests to use it.

The kernel and user process synchronize use of the buffers with atomic
operations, avoiding the need for system calls under load; the user
process may use select()/poll()/kqueue() to manage blocking while
waiting for network data if the user process is able to consume data
faster than the kernel generates it. Patchs to libpcap are available
to allow libpcap applications to transparently take advantage of this
support. Detailed information on the new API may be found in bpf(4),
including specific atomic operations and memory barriers required to
synchronize buffer use safely.

These changes modify the base BPF implementation to (roughly) abstrac
the current buffer model, allowing the new shared memory model to be
added, and add new monitoring statistics for netstat to print. The
implementation, with the exception of some monitoring hanges that break
the netstat monitoring ABI for BPF, will be MFC'd.

Zerocopy bpf buffers are still considered experimental are disabled
by default. To experiment with this new facility, adjust the
net.bpf.zerocopy_enable sysctl variable to 1.

Changes to libpcap will be made available as a patch for the time being,
and further refinements to the implementation are expected.

Sponsored by: Seccuris Inc.
In collaboration with: rwatson
Tested by: pwood, gallatin
MFC after: 4 months [1]

[1] Certain portions will probably not be MFCed, specifically things
    that can break the monitoring ABI.

16 years agoFix splitting into words of the .for expression to allow for
ru [Mon, 24 Mar 2008 12:33:28 +0000 (12:33 +0000)]
Fix splitting into words of the .for expression to allow for
spaces in values.  Without this change, the following valid
call broke due to parsing of .MAKEFLAGS in bsd.symver.mk:

cd /usr/src/lib/libc && make -n DEBUG_FLAGS="-DFOO -DBAR"

Spotted by: Igor Sysoev
Submitted by: Maxim Dounin, ru
MFC after: 1 week

16 years agoFix bugs in the previous revision.
ru [Mon, 24 Mar 2008 09:47:44 +0000 (09:47 +0000)]
Fix bugs in the previous revision.

16 years agoremove unneccessary tcbinfo lock acquisitions - set tp to null affter calling enter_t...
kmacy [Mon, 24 Mar 2008 05:21:10 +0000 (05:21 +0000)]
remove unneccessary tcbinfo lock acquisitions - set tp to null affter calling enter_timewait as we no longer own the inpcb

16 years ago - Greatly simplify vget() by removing the guarantee that any new
jeff [Mon, 24 Mar 2008 04:22:58 +0000 (04:22 +0000)]
 - Greatly simplify vget() by removing the guarantee that any new
   references to a vnode with VI_OWEINACT set will force the vinactive()
   call.  The kernel makes no guarantees about which reference was the
   last to close a file or when the actual inactive processing will
   happen.  The previous code was designed to preserve existing semantics
   in the face of shared locks, however, this was unnecessary.

Discussed with: mckusick

16 years ago - Don't acquire the vnode interlock in _vn_lock() unless no lock type
jeff [Mon, 24 Mar 2008 04:17:35 +0000 (04:17 +0000)]
 - Don't acquire the vnode interlock in _vn_lock() unless no lock type
   is requested.  Handle this case specially before the while loop.
 - Use the held vnode lock to check for VI_DOOMED.  The vnode lock and
   interlock must both be held to set VI_DOOMED so either one held, even
   shared, is sufficient to check it.

No objection by: kib

16 years ago - Remove an old comment; vnodes have been working without Giant for
jeff [Mon, 24 Mar 2008 04:11:40 +0000 (04:11 +0000)]
 - Remove an old comment; vnodes have been working without Giant for
   years now.
 - Clarify the locking required for VI_DOOMED in preparation for
   simplifications to vget() and vn_lock().

16 years agoLabel inp as unused in the non-INVARIANTS case
kmacy [Mon, 24 Mar 2008 00:29:01 +0000 (00:29 +0000)]
Label inp as unused in the non-INVARIANTS case

16 years agoFirst pass at (possibly futile) microoptimizing of cpu_switch. Results
peter [Sun, 23 Mar 2008 23:09:06 +0000 (23:09 +0000)]
First pass at (possibly futile) microoptimizing of cpu_switch.  Results
are mixed.  Some pure context switch microbenchmarks show up to 29%
improvement.  Pipe based context switch microbenchmarks show up to 7%
improvement.  Real world tests are far less impressive as they are
dominated more by actual work than switch overheads, but depending on
the machine in question, workload, kernel options, phase of moon, etc, a
few percent gain might be seen.

Summary of changes:
- don't reload MSR_[FG]SBASE registers when context switching between
  non-threaded userland apps.  These typically cost 120 clock cycles each
  on an AMD cpu (less on Barcelona/Phenom).  Intel cores are probably no
  faster on this.
- The above change only helps unthreaded userland apps that tend to use
  the same value for gsbase.  Threaded apps will get no benefit from this.
- reorder things like accessing the pcb to be in memory order, to give
  prefetching a better chance of working.  Operations are now in increasing
  memory address order, rather than reverse or random.
- Push some lesser used code out of the main code paths.  Hopefully
  allowing better code density in cache lines.  This is probably futile.
- (part 2 of previous item) Reorder code so that branches have a more
  realistic static branch prediction hint.  Both Intel and AMD cpus
  default to predicting branches to lower memory addresses as being
  taken, and to higher memory addresses as not being taken.  This is
  overridden by the limited dynamic branch prediction subsystem.  A trip
  through userland might overflow this.
- Futule attempt at spreading the use of the results of previous operations
  in new operations.  Hopefully this will allow the cpus to execute in
  parallel better.
- stop wasting 16 bytes at the top of kernel stack, below the PCB.
- Never load the userland fs/gsbase registers for kthreads, but preserve
  curpcb->pcb_[fg]sbase as caches for the cpu. (Thanks Jeff!)

Microbenchmarking this code seems to be really sensitive to things like
scheduling luck, timing, cache behavior, tlb behavior, kernel options,
other random code changes, etc.

While it doesn't help heavy userland workloads much, it does help high
context switch loads a little, and should help those that involve
switching via kthreads a bit more.

A special thanks to Kris for the testing and reality checks, and Jeff for
tormenting me into doing this. :)

This is still work-in-progress.

16 years agoCorrect an error in pmap_mincore() when applied to a 2MB page mapping:
alc [Sun, 23 Mar 2008 23:04:09 +0000 (23:04 +0000)]
Correct an error in pmap_mincore() when applied to a 2MB page mapping:
Use PG_PS_FRAME, not PG_FRAME, to obtain the physical address of the
2MB physical page from the PDE.

16 years agoExport TDP_KTHREAD to asm files.
peter [Sun, 23 Mar 2008 22:46:37 +0000 (22:46 +0000)]
Export TDP_KTHREAD to asm files.

16 years agoMove pcb_flags to make trivially better use of cache lines.
peter [Sun, 23 Mar 2008 22:45:51 +0000 (22:45 +0000)]
Move pcb_flags to make trivially better use of cache lines.

16 years agoProtect the setting of the fsbase/gsbase MSR registers and the
peter [Sun, 23 Mar 2008 22:44:56 +0000 (22:44 +0000)]
Protect the setting of the fsbase/gsbase MSR registers and the
pcb_[fg]sbase values with a critical section, like the rest of the kernel.

16 years agoInsulate inpcb consumers outside the stack from the lock type and offset within the...
kmacy [Sun, 23 Mar 2008 22:34:16 +0000 (22:34 +0000)]
Insulate inpcb consumers outside the stack from the lock type and offset within the pcb by adding accessor functions.

Reviewed by: rwatson
MFC after: 3 weeks

16 years agoTo date, we have assumed that the TLB will only set the PG_M bit in a
alc [Sun, 23 Mar 2008 20:38:01 +0000 (20:38 +0000)]
To date, we have assumed that the TLB will only set the PG_M bit in a
PTE if that PTE has the PG_RW bit set.  However, this assumption does
not hold on recent processors from Intel.  For example, consider a PTE
that has the PG_RW bit set but the PG_M bit clear.  Suppose this PTE
is cached in the TLB and later the PG_RW bit is cleared in the PTE,
but the corresponding TLB entry is not (yet) invalidated.
Historically, upon a write access using this (stale) TLB entry, the
TLB would observe that the PG_RW bit had been cleared and initiate a
page fault, aborting the setting of the PG_M bit in the PTE.  Now,
however, P4- and Core2-family processors will set the PG_M bit before
observing that the PG_RW bit is clear and initiating a page fault.  In
other words, the write does not occur but the PG_M bit is still set.

The real impact of this difference is not that great.  Specifically,
we should no longer assert that any PTE with the PG_M bit set must
also have the PG_RW bit set, and we should ignore the state of the
PG_M bit unless the PG_RW bit is set.  However, these changes enable
me to remove a work-around from pmap_promote_pde(), the superpage
promotion procedure.

(Note: The AMD processors that we have tested, including the latest,
the Phenom, still exhibit the historical behavior.)

Acknowledgments: After I observed the problem, Stephan (ups) was
instrumental in characterizing the exact behavior of Intel's recent
TLBs.

Tested by: Peter Holm

16 years agoYield the cpu in the kernel while iterating the list of the
kib [Sun, 23 Mar 2008 13:45:24 +0000 (13:45 +0000)]
Yield the cpu in the kernel while iterating the list of the
vnodes belonging to the mountpoint. Also, yield when in the
softdep_process_worklist() even when we are not going to sleep due to
buffer drain.

It is believed that the ULE fixed the problem [1], but the yielding
seems to be needed at least for the 4BSD case.

Discussed: on stable@, with bde
Reviewed by: tegge, jeff [1]
MFC after: 2 weeks

16 years agoWhen updating the install list for files which have had local changes
cperciva [Sun, 23 Mar 2008 13:41:54 +0000 (13:41 +0000)]
When updating the install list for files which have had local changes
merged with upgrade changes, don't try to compute the SHA256 hash of
files which don't exist.

Reported by: Jaakko Heinonen
MFC after: 1 week

16 years ago - Restore kse.h in this directory so other tools don't find it by mistake.
jeff [Sun, 23 Mar 2008 09:38:11 +0000 (09:38 +0000)]
 - Restore kse.h in this directory so other tools don't find it by mistake.
 - Restore the ability to debug kse coredumps in 8.0.

Suggested by: marcel

16 years agoPrevent the overflow in the calculation of the next page directory.
kib [Sun, 23 Mar 2008 07:07:27 +0000 (07:07 +0000)]
Prevent the overflow in the calculation of the next page directory.
The overflow causes the wraparound with consequent corruption of the
(almost) whole address space mapping.

As Alan noted, pmap_copy() does not require the wrap-around checks
because it cannot be applied to the kernel's pmap. The checks there are
included for consistency.

Reported and tested by: kris (i386/pmap.c:pmap_remove() part)
Reviewed by: alc
MFC after: 1 week

16 years agoMSI handling on some RealTek chips are broken so disable it by
yongari [Sun, 23 Mar 2008 05:35:18 +0000 (05:35 +0000)]
MSI handling on some RealTek chips are broken so disable it by
default.

Reported by: Giulio Ferro ( auryn AT zirakzigil DOT org )
Tested by: Giulio Ferro ( auryn AT zirakzigil DOT org )

16 years agoFor MSI capable hardwares, enable MSI enable bit in RL_CFG2
yongari [Sun, 23 Mar 2008 05:31:35 +0000 (05:31 +0000)]
For MSI capable hardwares, enable MSI enable bit in RL_CFG2
register.  If MSI was disabled by hw.re.msi_disable tunable
expliclty clear the MSI enable bit.

16 years agoSome RealTek chips are known to be buggy on DAC handling, so
yongari [Sun, 23 Mar 2008 05:13:45 +0000 (05:13 +0000)]
Some RealTek chips are known to be buggy on DAC handling, so
disable DAC by default.

16 years agoVLAN hardware tag information should be set for all desciptors of a
yongari [Sun, 23 Mar 2008 05:06:16 +0000 (05:06 +0000)]
VLAN hardware tag information should be set for all desciptors of a
multi-descriptor transmission attempt. Datasheet said nothing about
this requirements. This should fix a long-standing VLAN hardware
tagging issues with re(4).

Reported by: Giulio Ferro ( auryn AT zirakzigil DOT org )
Tested by: Giulio Ferro ( auryn AT zirakzigil DOT org )

16 years agoAlways honor configured VLAN/checksum offload capabilities.
yongari [Sun, 23 Mar 2008 04:59:13 +0000 (04:59 +0000)]
Always honor configured VLAN/checksum offload capabilities.
Previously re(4) used to blindly enable VLAN hardware tag stripping
and Rx checksum offload regardless of enabled optional features of
interface.

16 years agoNew release notes: KSE removed, cmx(4), uslcom(4), sf(4) update,
bmah [Sun, 23 Mar 2008 04:12:07 +0000 (04:12 +0000)]
New release notes:  KSE removed, cmx(4), uslcom(4), sf(4) update,
re(4) update, vr(4) update, TCP options padding fix, ata(4) spindown,
hptrr(4) 1.2, mmap(2)/ZFS fix, chflags(1) -v/-f, cp(1) -a, find(1)
primaries to match GNU find, split(1) -n, tar(1) -Z, bzip2 1.0.5.

Modified release notes:  CVS post-1.11.12 snapshot from 10 March 2008.

16 years agoRemove comment about "-r" flag from readlabel. "-r" is a no-op.
rodrigc [Sun, 23 Mar 2008 03:01:10 +0000 (03:01 +0000)]
Remove comment about "-r" flag from readlabel.  "-r" is a no-op.
The is comment is left over from the old disklabel command.

Reviewed by: phk

16 years agoRemove commented out code, thread suspension is done in thread library.
davidxu [Sun, 23 Mar 2008 02:03:06 +0000 (02:03 +0000)]
Remove commented out code, thread suspension is done in thread library.

16 years ago - Only return 1 from sync_vnode() in cases where the vnode is still
jeff [Sun, 23 Mar 2008 01:44:28 +0000 (01:44 +0000)]
 - Only return 1 from sync_vnode() in cases where the vnode is still
   at the head of the sync list.  This prevents sched_sync() from
   re-queueing a vnode which may have been freed already.

Discussed with: kib

16 years agoInstead of making a single geom_part.ko module, make a module
marcel [Sun, 23 Mar 2008 01:42:47 +0000 (01:42 +0000)]
Instead of making a single geom_part.ko module, make a module
for each partitioning scheme. The gpart code is currently non-
optional.

16 years ago - Pass BO_MTX(bo) to lockmgr in vtruncbuf, we don't own the vnode
jeff [Sun, 23 Mar 2008 01:42:19 +0000 (01:42 +0000)]
 - Pass BO_MTX(bo) to lockmgr in vtruncbuf, we don't own the vnode
   interlock here anymore.

Reported by: kris

16 years agoRedefine G_PART_SCHEME_DECLARE() from populating a private linker set
marcel [Sun, 23 Mar 2008 01:31:59 +0000 (01:31 +0000)]
Redefine G_PART_SCHEME_DECLARE() from populating a private linker set
to declaring a proper module. The module event handler is part of the
gpart core and will add the scheme to an internal list on module load
and will remove the scheme from the internal list on module unload.
This makes it possible to dynamically load and unload partitioning
schemes.

16 years agoAdd g_retaste(), which given a class will present all non-open providers
marcel [Sun, 23 Mar 2008 01:23:35 +0000 (01:23 +0000)]
Add g_retaste(), which given a class will present all non-open providers
to it for tasting. This is useful when the class, through means outside
the scope of GEOM, can claim providers previously unclaimed.

The g_retaste() function posts an event which is handled by the
g_retaste_event().

Event suggested by: phk

16 years agoWe need to prototype _start() as well, as we use it to test if we're running
cognet [Sat, 22 Mar 2008 20:34:07 +0000 (20:34 +0000)]
We need to prototype _start() as well, as we use it to test if we're running
from flash or from RAM.

Reported by: imp
MFC After: 3 days

16 years agoReuse the mbuf that was just retrieved from the receive ring if mbuf
qingli [Sat, 22 Mar 2008 18:13:39 +0000 (18:13 +0000)]
Reuse the mbuf that was just retrieved from the receive ring if mbuf
exhaustion is encountered. There was a fix made previously for this
problem but the solution (breaking out of the receive loop) does not
seem to work. mbuf reuse strategy is already adopted by other drivers
such as if_bge.  The problem was recreated and the patch is also
verified in the same test environment.

16 years agoadd hints to specify how NPE ports are mapped to MAC+PHY; these
sam [Sat, 22 Mar 2008 16:55:51 +0000 (16:55 +0000)]
add hints to specify how NPE ports are mapped to MAC+PHY; these
could be commented out as they just duplicate the defaults that
are built into the code

Reviewed by: imp
MFC after: 1 week

16 years agoImprove mac+phy configuration so that hints can be used to describe
sam [Sat, 22 Mar 2008 16:53:28 +0000 (16:53 +0000)]
Improve mac+phy configuration so that hints can be used to describe
layouts different than the defaults:
o hint.npe.0.mac="A", "B", etc. specifies the window for MAC register accesses
o hint.npe.0.mii="A", "B", etc. specifies PHY registers
o hint.npe.1.phy=%d specifies the PHY to map to a port

This allows devices like NSLU to be setup w/o code changes and will
also be used for forthcoming support for more Avila boards.

Reviewed by: imp
MFC after 1 week

16 years agosync w/ p4: minor cleanups to improve msgs
sam [Sat, 22 Mar 2008 16:39:30 +0000 (16:39 +0000)]
sync w/ p4: minor cleanups to improve msgs

16 years agoIn abort2(2): Accept a NULL arg pointer if nargs == 0
phk [Sat, 22 Mar 2008 16:32:52 +0000 (16:32 +0000)]
In abort2(2): Accept a NULL arg pointer if nargs == 0

16 years ago(finally) add the hal status to the diagnostic generated after
sam [Sat, 22 Mar 2008 16:27:47 +0000 (16:27 +0000)]
(finally) add the hal status to the diagnostic generated after
a failed ath_hal_reset call

MFC after: 3 days

16 years agoDefer state change on disassociate to avoid unnecessarily dropping the
sam [Sat, 22 Mar 2008 16:24:02 +0000 (16:24 +0000)]
Defer state change on disassociate to avoid unnecessarily dropping the
lease: track the current bssid and if it changes (as reported in an
assoc/reassoc) event only then kick the state machine.  This gives us
immediate response when roaming but otherwise causes us to fallback on
the normal state machine.

Reviewed by: brooks, jhb
MFC after: 3 weeks

16 years agocorrect syslog mask so LOG_DEBUG msgs are not lost
sam [Sat, 22 Mar 2008 16:18:07 +0000 (16:18 +0000)]
correct syslog mask so LOG_DEBUG msgs are not lost

MFC after: 2 weeks

16 years agoAdd a test case for options.c revision 1.26.
stefanf [Sat, 22 Mar 2008 14:07:49 +0000 (14:07 +0000)]
Add a test case for options.c revision 1.26.

16 years agoReset the internal state used for the 'getopts' built-in when 'shift' or 'set'
stefanf [Sat, 22 Mar 2008 14:06:01 +0000 (14:06 +0000)]
Reset the internal state used for the 'getopts' built-in when 'shift' or 'set'
are used to modify the arguments.  Not doing so caused random memory reads or
null pointer dereferences when 'getopts' was called again later (SUSv3 says
getopts produces unspecified results in this case).

PR: 48318

16 years agoIn route.c in newroute() there's a call to exit(0) if the command was
remko [Sat, 22 Mar 2008 12:50:43 +0000 (12:50 +0000)]
In route.c in newroute() there's a call to exit(0) if the command was
'get'. Since rtmsg() always gets called and returns 0 on success and -1
on failure, it's possible to exit with a suitable exit code by calling
exit(ret != 0) instead, as is done at the end of newroute().

PR: bin/112303
Submitted by: bruce@cran.org.uk
MFC after: 1 week

16 years agoAdd POSIX pthread API pthread_getcpuclockid() to get a thread's cpu
davidxu [Sat, 22 Mar 2008 09:59:20 +0000 (09:59 +0000)]
Add POSIX pthread API pthread_getcpuclockid() to get a thread's cpu
time clock id.

16 years ago - Complete part of the unfinished bufobj work by consistently using
jeff [Sat, 22 Mar 2008 09:15:16 +0000 (09:15 +0000)]
 - Complete part of the unfinished bufobj work by consistently using
   BO_LOCK/UNLOCK/MTX when manipulating the bufobj.
 - Create a new lock in the bufobj to lock bufobj fields independently.
   This leaves the vnode interlock as an 'identity' lock while the bufobj
   is an io lock.  The bufobj lock is ordered before the vnode interlock
   and also before the mnt ilock.
 - Exploit this new lock order to simplify softdep_check_suspend().
 - A few sync related functions are marked with a new XXX to note that
   we may not properly interlock against a non-zero bv_cnt when
   attempting to sync all vnodes on a mountlist.  I do not believe this
   race is important.  If I'm wrong this will make these locations easier
   to find.

Reviewed by: kib (earlier diff)
Tested by: kris, pho (earlier diff)

16 years agoFix a race where timeout/untimeout could cause crashes for Giant locked
alfred [Sat, 22 Mar 2008 07:29:45 +0000 (07:29 +0000)]
Fix a race where timeout/untimeout could cause crashes for Giant locked
code.

The bug:

There exists a race condition for timeout/untimeout(9) due to the
way that the softclock thread dequeues timeouts.

The softclock thread sets the c_func and c_arg of the callout to
NULL while holding the callout lock but not Giant.  It then drops
the callout lock and acquires Giant.

It is at this point where untimeout(9) on another cpu/thread could
be called.

Since c_arg and c_func are cleared, untimeout(9) does not touch the
callout and returns as if the callout is canceled.

The softclock then tries to acquire Giant and likely blocks due to
the other cpu/thread holding it.

The other cpu/thread then likely deallocates the backing store that
c_arg points to and finishes working and hence drops Giant.

Softclock resumes and acquires giant and calls the function with
the now free'd c_arg and we have corruption/crash.

The fix:

We need to track curr_callout even for timeout(9) (LOCAL_ALLOC)
callouts.  We need to free the callout after the softclock processes
it to deal with the race here.

Obtained from: Juniper Networks, iedowse
Reviewed by: jhb, iedowse
MFC After: 2 weeks.

16 years agoUse linker set to collection all target operations.
davidxu [Sat, 22 Mar 2008 05:40:44 +0000 (05:40 +0000)]
Use linker set to collection all target operations.

16 years agoAdd in a compat. mode so you can either open the card's device
ambrisko [Sat, 22 Mar 2008 02:57:49 +0000 (02:57 +0000)]
Add in a compat. mode so you can either open the card's device
node or directly open mfi0 and specify the card you want to talk to
in the ioctl.

16 years agoNo need to be gratuitously style(9) non-compliant here, even though
imp [Fri, 21 Mar 2008 20:38:28 +0000 (20:38 +0000)]
No need to be gratuitously style(9) non-compliant here, even though
C++ lets me get away with it.

16 years agoReplace reference from vinum.8 to gvinum.8, it was advised in the PR to
remko [Fri, 21 Mar 2008 20:16:25 +0000 (20:16 +0000)]
Replace reference from vinum.8 to gvinum.8, it was advised in the PR to
replace this with vinum.4, but that's the kernel interface manual, which
is not appropriate in my understanding.  I think that gvinum is a suitable
replacement for this.

PR: docs/121938
Submitted by: "Federico" <federicogalvezdurand at yahoo dot com>
MFC after: 3 days

16 years agoAdd ';' missed with the SYSINIT changes.
bz [Fri, 21 Mar 2008 18:31:42 +0000 (18:31 +0000)]
Add ';' missed with the SYSINIT changes.
Not noticed by tb as TCP_SIGNATURE is not in LINT.

MFC after: 1 month

16 years agoAdd the i915 GME device to DRM.
remko [Fri, 21 Mar 2008 16:38:42 +0000 (16:38 +0000)]
Add the i915 GME device to DRM.

PR: kern/121808
Submitted by: Volker Werth <volker at vwsoft dot com>
Approved by: imp (mentor, implicit for trivial changes)
MFC after: 3 days

16 years agoReduce contention on the vnode interlock by not acquiring the BO_LOCK
kib [Fri, 21 Mar 2008 12:38:44 +0000 (12:38 +0000)]
Reduce contention on the vnode interlock by not acquiring the BO_LOCK
around the check for the BV_BKGRDINPROG in the brelse() and bqrelse().
See the comment for the explanation why it is safe.

Tested by: pho
Submitted by: jeff

16 years agoReduce the acquisition of the vnode interlock in the ffs_read() and
kib [Fri, 21 Mar 2008 12:33:00 +0000 (12:33 +0000)]
Reduce the acquisition of the vnode interlock in the ffs_read() and
ffs_extread() when setting the IN_ACCESS flag by checking whether the
IN_ACCESS is already set. The possible race there is admissible.

Tested by: pho
Submitted by: jeff

16 years agoAdd MLINK for archive_write_close.
kaiw [Fri, 21 Mar 2008 11:10:20 +0000 (11:10 +0000)]
Add MLINK for archive_write_close.

Approved by: jkoshy(mentor), kientzle

16 years ago - Reduce contention on the global bdonelock and bpinlock by using
jeff [Fri, 21 Mar 2008 10:00:05 +0000 (10:00 +0000)]
 - Reduce contention on the global bdonelock and bpinlock by using
   a pool mutex to protect these sleep/wakeup/counter races.  This
   still is preferable to bloating each bio with a mtx.

16 years ago - Add a new td flag TDF_NEEDSUSPCHK that is set whenever a thread needs
jeff [Fri, 21 Mar 2008 08:23:25 +0000 (08:23 +0000)]
 - Add a new td flag TDF_NEEDSUSPCHK that is set whenever a thread needs
   to enter thread_suspend_check().
 - Set TDF_ASTPENDING along with TDF_NEEDSUSPCHK so we can move the
   thread_suspend_check() to ast() rather than userret().
 - Check TDF_NEEDSUSPCHK in the sleepq_catch_signals() optimization so
   that we don't miss a suspend request.  If this is set use the
   expensive signal path.
 - Set NEEDSUSPCHK when creating a new thread in thr in case the
   creating thread is due to be suspended as well but has not yet.

Reviewed by: davidxu (Authored original patch)

16 years agoResolve __error()'s PLT early so that it needs not to be resolved again,
davidxu [Fri, 21 Mar 2008 02:31:55 +0000 (02:31 +0000)]
Resolve __error()'s PLT early so that it needs not to be resolved again,
otherwise rwlock is recursivly called when signal happens and the __error
was never resolved before.