]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoInclude the thread name (in addition to the proc name) in "info threads."
emaste [Fri, 18 Jan 2008 18:57:27 +0000 (18:57 +0000)]
Include the thread name (in addition to the proc name) in "info threads."

16 years agoIn the rev. 1.153, the one place for converting minor number to unit
kib [Fri, 18 Jan 2008 18:07:04 +0000 (18:07 +0000)]
In the rev. 1.153, the one place for converting minor number to unit
was missed. As result, pty_create_slave() may index out of the names[]
bounds, creating wrong slave tty names.

Tested by: kensmith
Reviewed by: jhb
MFC after: 3 days

16 years agoUse nfsrv_destroycache() only once, else it crashes the server.
remko [Fri, 18 Jan 2008 17:03:36 +0000 (17:03 +0000)]
Use nfsrv_destroycache() only once, else it crashes the server.

PR: kern/118152
Submitted by: Bjoern Groenvall <bg at sics dot se>
Approved by: imp (mentor, a while ago already), jhb
MFC After: 3 days

16 years agorefactor code so it can run in a chroot without having to have /dev/mounted
julian [Fri, 18 Jan 2008 17:02:14 +0000 (17:02 +0000)]
refactor code so it can run in a chroot without having to have /dev/mounted
MFC After: 1 week

16 years agopcib is compiled in when "device pci" is specified.
brueffer [Fri, 18 Jan 2008 17:00:44 +0000 (17:00 +0000)]
pcib is compiled in when "device pci" is specified.

Submitted by: marius
Reviewed by: imp

16 years agoStyle changes from avatar.
ambrisko [Fri, 18 Jan 2008 16:34:18 +0000 (16:34 +0000)]
Style changes from avatar.

Submitted by: avatar

16 years agoFirst real attempt at proper locking. The locking is a little complicated
ambrisko [Fri, 18 Jan 2008 16:31:24 +0000 (16:31 +0000)]
First real attempt at proper locking.  The locking is a little complicated
since the the command and data that is being built to be sent to or read
from the HW lives in the softc.  Commands are later run via an_setdef etc.
In the ioctl path various references are kept to the data stored in
the softc so it needs to be protected.  Almost think of the command
in the softc a global variable since it essentially is.  Since locking
wasn't done in this type of context the commands would get corrupted.

Thanks to avatar@ for catching some lock issues and dhw@ for testing.

Things are a lot more stable except for the MPI-350 cards.  My an(4)
remote laptop stays on the network now.

The driver should be changed so that it uses private memory that is passed
to the functions that talk to the card.  Then only those functions would
really need to grab locks.

Reviewed by: avatar@

16 years agoMake sure reading td_runtime in critical section since thread may be
davidxu [Fri, 18 Jan 2008 13:00:28 +0000 (13:00 +0000)]
Make sure reading td_runtime in critical section since thread may be
preempted and td_runtime will be modified.

16 years agoIn tcp_ctloutput(), don't hold the inpcb lock over sooptcopyin(), rather,
rwatson [Fri, 18 Jan 2008 12:19:50 +0000 (12:19 +0000)]
In tcp_ctloutput(), don't hold the inpcb lock over sooptcopyin(), rather,
drop the lock and then re-acquire it, revalidating TCP connection state
assumptions when we do so.  This avoids a potential lock order reversal
(and potential deadlock, although none have been reported) due to the
inpcb lock being held over a page fault.

MFC after: 1 week
PR: 102752
Reviewed by: bz
Reported by: Václav Haisman <v dot haisman at sh dot cvut dot cz>

16 years agoCorrect the sysconf variable name, _SC_CLK_TCK.
ru [Fri, 18 Jan 2008 12:13:05 +0000 (12:13 +0000)]
Correct the sysconf variable name, _SC_CLK_TCK.

16 years agoudf_vget() shall vgone() the vnode when the file_entry cannot be allocated
kib [Fri, 18 Jan 2008 12:09:54 +0000 (12:09 +0000)]
udf_vget() shall vgone() the vnode when the file_entry cannot be allocated
or read from the volume. Otherwise, half-constructed vnode could be found
later and cause panic when accessed.

PR: 118322
MFC after: 1 week

16 years agoStill no new leapseconds: Bulletin C-35
phk [Fri, 18 Jan 2008 09:34:39 +0000 (09:34 +0000)]
Still no new leapseconds: Bulletin C-35

16 years agoRemove a chunk of duplicated code, test the destination address against the
thompsa [Fri, 18 Jan 2008 09:34:09 +0000 (09:34 +0000)]
Remove a chunk of duplicated code, test the destination address against the
bridge the same way we check member interfaces.

16 years ago_POSIX_THREAD_CPUTIME is now supported.
davidxu [Fri, 18 Jan 2008 08:48:32 +0000 (08:48 +0000)]
_POSIX_THREAD_CPUTIME is now supported.

16 years agoUse m_collapse(9) to collapse mbuf chains instead of relying on
yongari [Fri, 18 Jan 2008 08:32:08 +0000 (08:32 +0000)]
Use m_collapse(9) to collapse mbuf chains instead of relying on
shortest possible chain of mbufs of m_defrag(9). What we want is
chains of mbufs that can be safely stored to a Tx descriptor which
can have up to STGE_MAXTXSEGS mbufs. The ethernet controller does
not need to align Tx buffers on 32bit boundary. So the use of
m_defrag(9) was waste of time.

16 years agoAdd POSIX clock id CLOCK_THREAD_CPUTIME_ID, this can be used to measure
davidxu [Fri, 18 Jan 2008 07:04:42 +0000 (07:04 +0000)]
Add POSIX clock id CLOCK_THREAD_CPUTIME_ID, this can be used to measure
per-thread runtime in user code.

16 years agoI misread the Tinderbox error; this should really unbreak 64-bit builds.
kientzle [Fri, 18 Jan 2008 06:16:08 +0000 (06:16 +0000)]
I misread the Tinderbox error; this should really unbreak 64-bit builds.

Pointy hats, yep, keep 'em coming.  ;-/

16 years agoFix 64-bit build after my last commit. <sigh>
kientzle [Fri, 18 Jan 2008 06:08:39 +0000 (06:08 +0000)]
Fix 64-bit build after my last commit.  <sigh>

16 years agoThe previous commit caused the archive_write_disk interface to
kientzle [Fri, 18 Jan 2008 05:48:50 +0000 (05:48 +0000)]
The previous commit caused the archive_write_disk interface to
start obeying filesize limits; this test wasn't properly setting
file sizes before trying to write file data.

16 years agoIssues with hardlinks in newc-format files prompted me to
kientzle [Fri, 18 Jan 2008 05:05:58 +0000 (05:05 +0000)]
Issues with hardlinks in newc-format files prompted me to
write a new test to exercise the hardlink strategies used
by different archive formats (tar, old cpio, new cpio).
This uncovered two problems, both fixed by this commit:

1) Enforce file size when writing files to disk.

2) When restoring hardlink entries, if they have data associated, go
   ahead and open the file so we can write the data.

In particular, this fixes bsdtar/bsdcpio extraction of new cpio
formats where the "original" is empty and the subsequent "hardlink"
entry actually carries the data.  It also provides correct behavior
for old cpio archives where hardlinked entries have their bodies
stored multiple times in the archive; the last body should always be
the one that ends up in the final file.  The new pax format also
permits (but does not require) hardlinks to carry file data; again,
the last contents should always win.

Note that with any of these, a size of zero on a hardlink simply means
that the hardlink carries no data; it does not mean that the file has
zero size.  A non-zero size on a hardlink does provide the file size.

Thanks to: John Baldwin, for reminding me about this long-standing bug
    and sending me a simple example archive that prompted this test case

16 years agoReconnect the progress callback. It may not get called
kientzle [Fri, 18 Jan 2008 04:53:45 +0000 (04:53 +0000)]
Reconnect the progress callback.  It may not get called
as often as you might expect, but at least it will get called
now.

Thanks to: David Topham for asking how this got disconnected.

16 years agoSYSTEM_SCOPE_ONLY flag is no longer needed, it is the only mode libthr
davidxu [Fri, 18 Jan 2008 04:29:36 +0000 (04:29 +0000)]
SYSTEM_SCOPE_ONLY flag is no longer needed, it is the only mode libthr
supports.

16 years agoAdd a -P flag to display per-cpu cpu usage stats.
peter [Fri, 18 Jan 2008 01:43:14 +0000 (01:43 +0000)]
Add a -P flag to display per-cpu cpu usage stats.

16 years agoIEEE 802.1D-2004 states, frames containing any of the group MAC Addresses
thompsa [Fri, 18 Jan 2008 00:19:10 +0000 (00:19 +0000)]
IEEE 802.1D-2004 states, frames containing any of the group MAC Addresses
specified in Table 7-10 in their destination address field shall not be relayed
by the Bridge. Add a check in bridge_forward() to adhere to this.

PR: kern/119744

16 years ago- Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and
jhb [Thu, 17 Jan 2008 23:37:47 +0000 (23:37 +0000)]
- Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and
  re_defrag() and use m_collapse() instead.
- Replace a reference to ath_defrag() in a comment in if_wpi.c with
  m_collapse().

16 years agoAdd 'compat_freebsd[4567]' features corresponding to the kernel options
jhb [Thu, 17 Jan 2008 22:46:32 +0000 (22:46 +0000)]
Add 'compat_freebsd[4567]' features corresponding to the kernel options
COMPAT_FREEBSD[4567].

MFC after: 1 week
Requested by: kris

16 years agoAdd a new 'add-kld <kld>' command to kgdb to make it easier to analyze
jhb [Thu, 17 Jan 2008 21:43:12 +0000 (21:43 +0000)]
Add a new 'add-kld <kld>' command to kgdb to make it easier to analyze
crash dumps with kernel modules.  The command is basically a wrapper
around add-symbol-file except that it uses the kernel linker data
structures and the ELF section headers of the kld to calculate the
section addresses add-symbol-file needs.

The 'kld' parameter may either be an absolute path or a relative path.
kgdb looks for the kld in several locations checking for variants with
".symbols" or ".debug" suffixes in each location.  The first location it
tries is just opening the specified path (this handles absolute paths and
looks for the kld relative to the current directory otherwise).  Next
it tries to find the module in the same directory of the kernel image
being used.  If that fails it extracts the kern.module_path from the
kernel being debugged and looks in each of those paths.

The upshot is that for the common cases of debugging /boot/kernel/kernel
where the module is in either /boot/kernel or /boot/modules one can merely
do 'add-kld foo.ko'.

MFC after: 1 week

16 years ago- remove bogus_imm counter
kmacy [Thu, 17 Jan 2008 21:25:58 +0000 (21:25 +0000)]
- remove bogus_imm counter
- disable pcpu cluster cache by default until reference counting is handled
  correctly for held clusters - can be re-enable by sysctl

16 years agopromote ath_defrag to m_collapse (and retire private+unused
sam [Thu, 17 Jan 2008 21:25:09 +0000 (21:25 +0000)]
promote ath_defrag to m_collapse (and retire private+unused
m_collapse from cxgb)

Reviewed by: pyun, jhb, kmacy
MFC after: 2 weeks

16 years agoRemove remnants of old *_FORTRAN build flags.
brueffer [Thu, 17 Jan 2008 20:51:58 +0000 (20:51 +0000)]
Remove remnants of old *_FORTRAN build flags.

Approved by: rwatson (mentor)
MFC after: 3 days

16 years agoRemove a conditional that is always true.
jhb [Thu, 17 Jan 2008 20:15:15 +0000 (20:15 +0000)]
Remove a conditional that is always true.

MFC after: 2 weeks

16 years agoUse pause(9) instead of a tsleep() on a stack variable.
jhb [Thu, 17 Jan 2008 20:11:58 +0000 (20:11 +0000)]
Use pause(9) instead of a tsleep() on a stack variable.

MFC after: 1 week

16 years agoNote the driver support PERC and LSI1078 based controllers.
ambrisko [Thu, 17 Jan 2008 19:36:13 +0000 (19:36 +0000)]
Note the driver support PERC and LSI1078 based controllers.

Prompted by: Vlad GALU

16 years agoCorrect that LSI 0060 is a mfi device and not mpt.
ambrisko [Thu, 17 Jan 2008 19:29:01 +0000 (19:29 +0000)]
Correct that LSI 0060 is a mfi device and not mpt.

16 years agoEliminate warnings by adding headers.
emaste [Thu, 17 Jan 2008 18:59:59 +0000 (18:59 +0000)]
Eliminate warnings by adding headers.

16 years agoUse cpu_spinwait() (i.e., "pause") when spinning on rdtsc during DELAY().
jhb [Thu, 17 Jan 2008 18:59:38 +0000 (18:59 +0000)]
Use cpu_spinwait() (i.e., "pause") when spinning on rdtsc during DELAY().

MFC after: 1 week

16 years agoRetire PMAP_DIAGNOSTIC. Any useful diagnostics that were conditionally
alc [Thu, 17 Jan 2008 18:25:52 +0000 (18:25 +0000)]
Retire PMAP_DIAGNOSTIC.  Any useful diagnostics that were conditionally
compiled under PMAP_DIAGNOSTIC are now KASSERT()s.  (Note: The kernel
option DIAGNOSTIC still disables inlining of certain pmap functions.)

Eliminate dead code from pmap_enter().  This code implemented an assertion.
On i386, an equivalent check is already implemented.  However, on amd64,
a small change is required to implement an equivalent check.

Eliminate \n from a nearby panic string.

Use KASSERT() to reimplement pmap_copy()'s two assertions.

16 years agoAdd a macro STRICT_ASSIGN() to help avoid the compiler bug that
bde [Thu, 17 Jan 2008 17:02:11 +0000 (17:02 +0000)]
Add a macro STRICT_ASSIGN() to help avoid the compiler bug that
assignments and casts don't clip extra precision, if any.  The
implementation is to assign to a temporary volatile variable and read
the result back to assign to the original lvalue.

lib/msun currently 2 different hard-coded hacks to avoid the problem
in just a few places and needs it in a few more places.  One variant
uses volatile for the original lvalue.  This works but is slower than
necessary.  Another temporarily casts the lvalue to volatile.  This
broke with gcc-4.2.1 or earlier (gcc now stores to the lvalue but
doesn't load from it).

16 years agoAdd an alternative view of the bits in an 80-bit long double (64+16
bde [Thu, 17 Jan 2008 16:39:07 +0000 (16:39 +0000)]
Add an alternative view of the bits in an 80-bit long double (64+16
instead of 32+32+15+1) on all arches that have such long doubles (amd64,
ia64 and i386).  Large objects should be be accessed in large units,
and the 32+32+15+1[+padding] decomposition asks for almost the opposite
of that, sometimes resulting in very slow accesses depending on how
well the compiler ignores what we ask for and converts to the best
units for the given machine.  E.g., on Athlons, there is a 10-20 cycle
penalty for accessing the middle 32-bit word immediately after an
80-bit store.

Whether actually using the alternative view is better is very machine-
dependent.  A 32+32+16 view is probably best with old 32-bit systems
and gcc through 4.2.1.  The compiler should mostly avoid the view and
generate best accesses, but gcc-4.2.1 is far from doing that.  I think
64+16 is best for now.  Similarly for doubles -- they should be using
64+0 especially on 64-bit machines, but fdlibm uses 32+32 extensively
for them.  Fortunately, in 64-bit mode for doubles, gcc already ignores
the 32+32-bit view and generates best accesses in many cases.

16 years agoTranslate from the i386. All FP constants and operations are evaluated
bde [Thu, 17 Jan 2008 13:12:46 +0000 (13:12 +0000)]
Translate from the i386.  All FP constants and operations are evaluated
in the range and precision of their type(s) on amd64, but FLT_EVAL_METHOD
said that they were evalated in the "interesting" (buggy) i387 methods.
float_t was broken compatibly with FLT_EVAL_METHOD.

These definitions seem to be broken on powerpc and possibly on arm.
float_t is float on powerpc with gcc [-notraditional] according to
glibc, and FLT_EVAL_METHOD is marked with XXX on arm.

16 years agoUnbreak build by adding the missing parameter to pmap_enter().
cognet [Thu, 17 Jan 2008 12:41:59 +0000 (12:41 +0000)]
Unbreak build by adding the missing parameter to pmap_enter().

16 years agoSync from OpenBSD r1.118, nuke clause 3 & 4.
thompsa [Thu, 17 Jan 2008 09:46:16 +0000 (09:46 +0000)]
Sync from OpenBSD r1.118, nuke clause 3 & 4.

16 years agoFix lock ordering panic by not calling ether_ioctl with port lock held
kmacy [Wed, 16 Jan 2008 21:33:34 +0000 (21:33 +0000)]
Fix lock ordering panic by not calling ether_ioctl with port lock held

Reported by: rrs

16 years agoFix some style nits.
remko [Wed, 16 Jan 2008 19:36:21 +0000 (19:36 +0000)]
Fix some style nits.

Prodded by: brueffer
MFC After: 3 days

16 years agoANSIfy and remove register.
delphij [Wed, 16 Jan 2008 19:27:43 +0000 (19:27 +0000)]
ANSIfy and remove register.

Resulting binary verified with strip(1)+md5(1).

16 years agoAdd a header containing constants for the various HPET registers and their
jhb [Wed, 16 Jan 2008 18:47:07 +0000 (18:47 +0000)]
Add a header containing constants for the various HPET registers and their
fields and update the code to match.  The PR served more as an inspiration
than providing the actual diffs.

MFC after: 1 week
PR: kern/112544

16 years agoUse a phony .POSIX target. This seems to be the way to
obrien [Wed, 16 Jan 2008 17:16:36 +0000 (17:16 +0000)]
Use a phony .POSIX target.   This seems to be the way to
turn off the stuff in src/usr.bin/make/main.c rev 1.161.

16 years agoAdd a set of regression tests for the POSIX shm API (shm_open(2) and
jhb [Wed, 16 Jan 2008 15:51:24 +0000 (15:51 +0000)]
Add a set of regression tests for the POSIX shm API (shm_open(2) and
shm_unlink(2)).

16 years agoRemove WITHOUT_FORTRAN from the XMAKE target, it doesn't exist anymore.
brueffer [Wed, 16 Jan 2008 15:05:49 +0000 (15:05 +0000)]
Remove WITHOUT_FORTRAN from the XMAKE target, it doesn't exist anymore.

Reviewed by: imp, kan
Approved by: rwatson (mentor)
MFC after: 3 days

16 years agoDont accidentally remove a filesocket which is still in use. This gives
remko [Wed, 16 Jan 2008 13:54:40 +0000 (13:54 +0000)]
Dont accidentally remove a filesocket which is still in use. This gives
problems when the DRM driver is loaded and the AIXGL extension is loaded
, the AIXGL driver requests a drm_close and this will cause the radeon
driver to fail while starting X windows.

PR: kern/114688
Submitted by: vehemens <vehemens at verizon dot net>
Prodded by: Robert Noland
Approved by: imp (mentor, a while ago already), anholt
MFC After: 1 week

16 years agoBump manpage date for rev 1.27
keramida [Wed, 16 Jan 2008 07:00:55 +0000 (07:00 +0000)]
Bump manpage date for rev 1.27

MFC after: 3 days

16 years agoDocument that loader(8) stops reading `loader.conf' when it
keramida [Wed, 16 Jan 2008 06:59:22 +0000 (06:59 +0000)]
Document that loader(8) stops reading `loader.conf' when it
encounters a syntax error, and add a tip about adding first
the `vital' options and then experimental ones.

PR: docs/119658
Submitted by: Julian Stacey, jhs at berklix.org

16 years agoremove superfluous debug printfs
kmacy [Wed, 16 Jan 2008 02:39:33 +0000 (02:39 +0000)]
remove superfluous debug printfs

16 years agoRemove duplicate cpufreq levels, i.e. ones that are within 25 Mhz of each
njl [Wed, 16 Jan 2008 01:05:21 +0000 (01:05 +0000)]
Remove duplicate cpufreq levels, i.e. ones that are within 25 Mhz of each
other.  The first one survives, the rest are removed.  So far, it appears
only some acpi_perf(4) BIOS tables have these invalid states, but address
this in the core to be sure to handle other potential driver data.

PR: kern/114722
Tested by: stefan.lambrev / moneybookers.com
MFC after: 3 days

16 years agoFix mbuf leak caused by freeing packet zone clusters but not their associated mbufs
kmacy [Wed, 16 Jan 2008 00:28:30 +0000 (00:28 +0000)]
Fix mbuf leak caused by freeing packet zone clusters but not their associated mbufs

- Track packet zone mbufs separately from other mbufs
- free packet zone buffers via m_free rather than trying to manage the refcount
  as with clusters - its refcount and management seems to be "special"

16 years agoput tx queue size back to 1024
kmacy [Wed, 16 Jan 2008 00:26:04 +0000 (00:26 +0000)]
put tx queue size back to 1024

16 years agoOptimize this a bit better.
das [Tue, 15 Jan 2008 23:31:24 +0000 (23:31 +0000)]
Optimize this a bit better.

Submitted by: bde (although these aren't all of his changes)

16 years agoUse '%zd' to print PIO_LEN since it involves a size_t (via sizeof()) to
jhb [Tue, 15 Jan 2008 22:01:26 +0000 (22:01 +0000)]
Use '%zd' to print PIO_LEN since it involves a size_t (via sizeof()) to
appease the tinderbox on 32-bit platforms.

Tested on: amd64, i386

16 years agoDon't cache the new-bus name of a PCI device in the PCI conf structure,
jhb [Tue, 15 Jan 2008 21:40:46 +0000 (21:40 +0000)]
Don't cache the new-bus name of a PCI device in the PCI conf structure,
but reread it from the device_t every time the device list is fetched.
Previously the device name in pciconf -l would not be updated when a driver
was unloaded or if a device was detached and attached to a different
driver.

MFC after: 1 week
PR: kern/104777
Submitted by: "Iasen Kostoff"  tbyte | otel net

16 years agoAdd optional support to mxge for MSI-X interrupts and multiple receive
gallatin [Tue, 15 Jan 2008 20:34:49 +0000 (20:34 +0000)]
Add optional support to mxge for MSI-X interrupts and multiple receive
queues (which we call slices).  The NIC will steer traffic into up to
hw.mxge.max_slices different receive rings based on a configurable
hash type (hw.mxge.rss_hash_type).

Currently the driver defaults to using a single slice, so the default
behavior is unchanged.  Also, transmit from non-zero slices is
disabled currently.

16 years agoWITHOUT_FORTRAN was removed some time ago. Regen src.conf.5.
brueffer [Tue, 15 Jan 2008 19:54:17 +0000 (19:54 +0000)]
WITHOUT_FORTRAN was removed some time ago.  Regen src.conf.5.

PR: 119562
Submitted by: Daniel Rucci <dan@rucci.org>
MFC after: 3 days

16 years agoHide common prints under bootverbose.
sobomax [Tue, 15 Jan 2008 19:21:08 +0000 (19:21 +0000)]
Hide common prints under bootverbose.

Obtained from: src/sys/dev/rr232x/osm_bsd.c, rev.1.2-1.3
MFC after: 2 weeks

16 years agoRemove some now-unused macros.
jhb [Tue, 15 Jan 2008 18:55:52 +0000 (18:55 +0000)]
Remove some now-unused macros.

MFC after: 1 week

16 years agoFix a few minor issues based on a bug report and reading over the HPET
jhb [Tue, 15 Jan 2008 18:50:47 +0000 (18:50 +0000)]
Fix a few minor issues based on a bug report and reading over the HPET
spec:
- Use read/modify/write cycles to enable and disable the HPET instead of
  writing 0 to reserved bits.
- Shutdown the HPET during suspend as encouraged by the spec.
- Fail to attach to an HPET with a period of zero.

MFC after: 1 week
PR: kern/119675 [3]
Reported by: Leo Bicknell | bicknell ufp.org

16 years agoMake test00 compilable again.
sobomax [Tue, 15 Jan 2008 18:34:47 +0000 (18:34 +0000)]
Make test00 compilable again.

16 years agoHandle Zip archives that are "multi-part archives with only
kientzle [Tue, 15 Jan 2008 16:27:15 +0000 (16:27 +0000)]
Handle Zip archives that are "multi-part archives with only
one part" by simply ignoring the marker at the beginning
of the file.  (Zip archivers reserve four bytes at the beginning
of each part of a multi-part archive, if it happens to only
require one part, those four bytes get filled with a placeholder
that can be ignored.)

Thanks to: Marius Nuennerich,
 for pointing me to a Zip archive that libarchive couldn't handle
MFC after: 7 days

16 years agoPut back the openpty(3) and ptsname(3) fixes but don't disable ptsname(3)
jhb [Tue, 15 Jan 2008 15:36:23 +0000 (15:36 +0000)]
Put back the openpty(3) and ptsname(3) fixes but don't disable ptsname(3)
on pts(4) devices this time.  This fixes the issues while leaving pts(4)
enabled on HEAD.

16 years agoFix accidental swap of "const" for "static" in mxge firmware byte arrays
gallatin [Tue, 15 Jan 2008 15:04:40 +0000 (15:04 +0000)]
Fix accidental swap of "const" for "static" in mxge firmware byte arrays
caused by running my import script with the wrong args.

16 years agoBack out last commit, since it accidentally broke pts.
cperciva [Tue, 15 Jan 2008 13:59:13 +0000 (13:59 +0000)]
Back out last commit, since it accidentally broke pts.

The security fix will be re-committed soon, hopefully without breaking
anything.

16 years agoUpdate to firmware version 1.4.29 from 1.4.25. Relevant changes include:
gallatin [Tue, 15 Jan 2008 13:29:32 +0000 (13:29 +0000)]
Update to firmware version 1.4.29 from 1.4.25.  Relevant changes include:

- Fix a bug introduced in 1.4.20 where speculative read by the processor in the
   write-only doorbell region would cause a target-abort (as opposed to simply
   returning random data). This could manifest itself as NMI or machine freeze
   depending on how the BIOS/OS/chipset configuration handles target-abort.

- Add support for new revisions of -R cards (with AEL1002/AEL1010 xaui->xfi)

- Increase an internal timing (dispatch engine): fix possible spurious reset
  (seen on very few cards).

16 years ago - When executing the 'tryself' branch in sched_pickcpu() look at the
jeff [Tue, 15 Jan 2008 09:03:09 +0000 (09:03 +0000)]
 - When executing the 'tryself' branch in sched_pickcpu() look at the
   lowest priority on the queue for the current cpu vs curthread's
   priority.  In the case that curthread is waking up many threads of a
   lower priority as would happen with a turnstile_broadcast() or wakeup()
   of many threads this prevents them from all ending up on the current cpu.
 - In sched_add() make the relationship between a scheduled ithread and
   the current cpu advisory rather than strict.  Only give the ithread
   affinity for the current cpu if it's actually being scheduled from
   a hardware interrupt.  This prevents it from migrating when it simply
   blocks on a lock.

Sponsored by: Nokia

16 years ago- Simplify mb_free_ext_fast
kmacy [Tue, 15 Jan 2008 08:08:09 +0000 (08:08 +0000)]
- Simplify mb_free_ext_fast
- increase asserts for mbuf accounting
- track outstanding mbufs (maps very closely to leaked)
- actually only create one thread per port if !multiq
    Oddly enough this fixes the use after free

- move txq_segs to stack in t3_encap
- add checks that pidx doesn't move pass cidx
- simplify mbuf free logic in collapse mbufs routine

16 years agoFix some bugs in wall(1):
das [Tue, 15 Jan 2008 07:40:30 +0000 (07:40 +0000)]
Fix some bugs in wall(1):
- Handle wrapping correctly when \r appears in the input, and don't
  remove the \r from the output.
- For lines longer than 79 characters, don't drop every 80th character.
- Style: Braces around compound while statement.

PR: 114498
Submitted by: Niclas Zeising <niclas.zeising@gmail.com> (earlier version)

16 years agoIn getttyent(3), if /etc/ttys doesn't end in a newline, don't
das [Tue, 15 Jan 2008 06:50:50 +0000 (06:50 +0000)]
In getttyent(3), if /etc/ttys doesn't end in a newline, don't
freak out and keep trying to expand the buffer until realloc()
fails.

PR: 114398

16 years agoQuotacheck may possibly skip quota accounting for up to 2 files
mpp [Tue, 15 Jan 2008 06:33:20 +0000 (06:33 +0000)]
Quotacheck may possibly skip quota accounting for up to 2 files
on a filesystem if the quota data files reside on a different
filesystem (e.g. the userquota=/somepath,groupquota=/somepath2
options are specified in /etc/fstab to place the quota files
somewhere other than the default location).

Fix quotacheck to only skip accounting if the quota data file
actually resides on the filesystem being checked.

16 years agoSupport uppercase hex digits in cpio archives.
kientzle [Tue, 15 Jan 2008 04:56:48 +0000 (04:56 +0000)]
Support uppercase hex digits in cpio archives.

Thanks to: Joshua Kwan
MFC after: 7 days

16 years agoProtect arg in macro M_ASSERTPKTHDR.
yongari [Tue, 15 Jan 2008 04:00:12 +0000 (04:00 +0000)]
Protect arg in macro M_ASSERTPKTHDR.

16 years agoFix build.
yongari [Tue, 15 Jan 2008 03:47:24 +0000 (03:47 +0000)]
Fix build.

16 years ago- move WR_LEN in to cxgb_adapter.h add PIO_LEN to make intent clearer
kmacy [Tue, 15 Jan 2008 03:27:42 +0000 (03:27 +0000)]
- move WR_LEN in to cxgb_adapter.h add PIO_LEN to make intent clearer
- move cxgb_tx_common in to cxgb_multiq.c and rename to cxgb_tx
- move cxgb_tx_common dependencies
- further simplify cxgb_dequeue_packet for the non-multiqueue case
- only launch one service thread per port in the non-multiq case
- remove dead cleaning code from cxgb_sge.c
- simplify PIO case substantially in by returning directly from mbuf collapse
  and just using m_copydata
- remove gratuitous m_gethdr in the rx path
- clarify freeing of mbufs in collapse

16 years agoremove superfluous locking from dequeue
kmacy [Tue, 15 Jan 2008 03:21:02 +0000 (03:21 +0000)]
remove superfluous locking from dequeue

16 years agoOverhaul re(4).
yongari [Tue, 15 Jan 2008 01:10:31 +0000 (01:10 +0000)]
Overhaul re(4).
o Increased number of Rx/Tx descriptors to 256 for 8169 GigEs
  because it's hard to push the hardware to the limit with default
  64 descriptors.
  TSO requires large number of Tx descriptors to pass a full sized
  TCP segment(65535 bytes IP packet) to hardware. Previously it
  consumed 32 Tx descriptors, assuming MCLBYTES DMA segment size,
  to send the TCP segment which means re(4) couldn't queue more
  than two full sized IP packets.
  For 8139C+ it still uses 64 Rx/Tx descriptors due to its hardware
  limitations. With this changes there are (very) small waste of
  memory for 8139C+ users but I don't think it would affect 8139C+
  users for most cases.
o Various bus_dma(9) fixes.
   - The hardware supports DAC so allow 64bit DMA operations.
   - Removed BUS_DMA_ALLOC_NOW flag.
   - Increased DMA segment size to 4096 from MCLBYTES because TSO
     consumes too many descriptors with MCLBYTES DMA segment size.
   - Tx/Rx side bus_dmamap_load_mbuf_sg(9) support. With these
     changes the code is more readable than previous one and got a
     (slightly) better performance as it doesn't need to pass/
     decode arguments to/from callback function.
   - Removed unnecessary callback function re_dmamap_desc() and
     nuked rl_dmaload_arg structure which was used in the callback.
   - Additional protection for DMA map load failure. In case of
     failure reuse current map instead of returning a bogus DMA
     map.
  -  Deferred DMA map unloading/sync operation for maximum
     performance until we really need to load new DMA map. If we
     happen to reuse current map(e.g. input error) there is no need
     to sync/unload/load again.
  -  The number of allowable Tx DMA segments for a mbuf chains are
     now 32 instead of magic nseg value. If the number of available
     Tx descriptors are short enough to send highly fragmented mbuf
     chains an optimized re_defrag() is called to collapse mbuf
     chains which is supposed to be much faster than m_defrag(9).
     re_defrag() was borrowed from ath(4).
   - Separated Rx/Tx DMA tag from a common DMA tag such that Rx DMA
     tag correctly uses DMA maps that were created with DMA alignment
     restriction(8bytes alignments). Tx DMA tag does not have such
     alignment limitation.
   - Added additional sanity checks for DMA ring map load failure.
   - Added additional spare Rx DMA map for graceful handling of Rx
     DMA map load failure.
   - Fixed misused bus_dmamap_sync(9) and added missing
     bus_dmamap_sync(9) in re_encap()/re_txeof()/re_rxeof().
o Enabled TSO again as re(4) have reasonable number of Tx
  descriptors.
o Don't touch DMA address of a Tx descriptor in re_txeof(). It's
  not needed.
o Fix incorrect update of if_ierrors counter. For Rx buffer
  shortage it should update if_qdrops as the buffer is reused.
o Added checks for unsupported H/W revisions and return ENXIO for
  these hardwares. This is required to remove resource allocation
  code in re_probe as other drivers do in device probe routine.
o Modified descriptor index manipulation macros as it's now possible
  to have different number of descriptors for Rx/Tx.
o In re_start, to save a lock operation, use IFQ_DRV_IS_EMPTY before
  trying to invoke IFQ_DRV_DEQUEUE. Also don't blindly call re_encap
  since we already know the number of available Tx descriptors in
  advance.
o Removed RL_TX_DESC_THLD which was used to reserve RL_TX_DESC_THLD
  descriptors in Tx path. There is no such a limitation mentioned in
  8139C+/8169/8110/8168/8101/8111 datasheet and it seems to work ok
  without reserving RL_TX_DESC_THLD descriptors.
o Fix a comment for RL_GTXSTART. The register is 8bits register.
o Added comments for 8169/8139C+ hardware restrictions on descriptors.
o Removed forward declaration for "struct rl_softc", it's not needed.
o Added a new structure rl_txdesc for Tx descriptor managements and
  a structure rl_rxdesc for Rx descriptor managements.
o Removed unused member variable rl_intlock in driver softc. There are
  still several unused member variables which are supposed to be used
  to access hardware statistics counters. But it seems that accessing
  hardware counters were not implemented yet.

16 years agoUpdate the manpage for openpty(3) to account for the recent fixes.
jhb [Mon, 14 Jan 2008 23:49:56 +0000 (23:49 +0000)]
Update the manpage for openpty(3) to account for the recent fixes.
Specifically, remove the BUGS section and note that openpty(3) now always
does the various security-related steps.  Also, update the error return
value section.  The PR below is for the original bug rather than the doc
updates.

MFC after: 1 week
PR: bin/9770

16 years agoFix issues which allow snooping on ptys. [08:01]
cperciva [Mon, 14 Jan 2008 22:56:05 +0000 (22:56 +0000)]
Fix issues which allow snooping on ptys. [08:01]

Fix an off-by-one error in inet_network(3). [08:02]

Security: FreeBSD-SA-08:01.pty
Security: FreeBSD-SA-08:02.libc

16 years agoUpdate the KVA_PAGES comments for the effect that PAE has on it. It
peter [Mon, 14 Jan 2008 22:53:01 +0000 (22:53 +0000)]
Update the KVA_PAGES comments for the effect that PAE has on it.  It
becomes a unit size of 2MB instead of 4MB and must be a multiple of 8 to
get a valid KERNBASE.

16 years agoAdd a CTASSERT that KERNBASE is valid. This is usually messed up by an
peter [Mon, 14 Jan 2008 22:51:43 +0000 (22:51 +0000)]
Add a CTASSERT that KERNBASE is valid.  This is usually messed up by an
invalid KVA_PAGES, so add a pointer to there.

16 years agoMake pmap_is_prefaultable() more TLB friendly. Specifically, make it use
alc [Mon, 14 Jan 2008 21:25:06 +0000 (21:25 +0000)]
Make pmap_is_prefaultable() more TLB friendly.  Specifically, make it use
the kernel's direct map instead of the pmap's recursive mapping to access
the lowest level in the page table.  The direct map is preferable for two
reasons: (1) The TLB is more likely to hold the required direct mapping
because pmap_enter() has already used the direct map to access a nearby
PTE and (2) loading a direct mapping into the TLB involves walking only 2
or 3 levels of the page table instead of 4.

16 years agoChanging 'r' to a size_t in the previous commit turned quicksort
das [Mon, 14 Jan 2008 09:21:34 +0000 (09:21 +0000)]
Changing 'r' to a size_t in the previous commit turned quicksort
into slowsort for some sequences because different parts of the
code used 'r' to store two different things, one of which was
signed. Clean things up by splitting 'r' into two variables, and
use a more meaningful name.

16 years ago- Assert that immpkt is not set
kmacy [Mon, 14 Jan 2008 07:55:56 +0000 (07:55 +0000)]
- Assert that immpkt is not set
- convert %lx to 32-bit safe %jx

16 years agoImplement WOL capability.
yongari [Mon, 14 Jan 2008 07:16:48 +0000 (07:16 +0000)]
Implement WOL capability.
 - Turn on WOL bits in suspend/shutdown method.
 - WOL is disabled in resume routine as WOL can interfere normal
   Rx operation.
 - Move stge_reset() to stge_init_locked() as resetting hardware
   clears configured Rx information which in turn results in
   non-working Rx module after suspend/shutdown operation.

16 years agoIncrement major version to mark the ABI change between RELENG_7 and -HEAD.
jkoshy [Mon, 14 Jan 2008 06:33:41 +0000 (06:33 +0000)]
Increment major version to mark the ABI change between RELENG_7 and -HEAD.

16 years ago- Add more extensive sanity checks
kmacy [Mon, 14 Jan 2008 06:00:41 +0000 (06:00 +0000)]
- Add more extensive sanity checks
- remove initial dequeue from cxgb_start as it was causing an mbuf to be referenced twice

16 years agoMake back pressure visible more quickly, particularly now that we maintain a queue...
kmacy [Mon, 14 Jan 2008 05:59:06 +0000 (05:59 +0000)]
Make back pressure visible more quickly, particularly now that we maintain a queue internally

16 years agoAdd extensive sanity checking to buf_ring
kmacy [Mon, 14 Jan 2008 05:56:03 +0000 (05:56 +0000)]
Add extensive sanity checking to buf_ring

16 years agoTests for lrintl() and llrintl(). I didn't add anything specially
das [Mon, 14 Jan 2008 02:18:00 +0000 (02:18 +0000)]
Tests for lrintl() and llrintl(). I didn't add anything specially
tailored for the long double format; instead, I just modified the existing
tests to test lrintl() and llrintl() as well.

16 years agoImplement rintl(), nearbyintl(), lrintl(), and llrintl().
das [Mon, 14 Jan 2008 02:12:07 +0000 (02:12 +0000)]
Implement rintl(), nearbyintl(), lrintl(), and llrintl().
Thanks to bde@ for feedback and testing of rintl().

16 years agoAdd cxgb_multiq.c to the cxgb build for static linking
kmacy [Mon, 14 Jan 2008 00:59:33 +0000 (00:59 +0000)]
Add cxgb_multiq.c to the cxgb build for static linking

16 years agoSince the tar bidder can never get called more than once, it
kientzle [Sun, 13 Jan 2008 23:50:30 +0000 (23:50 +0000)]
Since the tar bidder can never get called more than once, it
doesn't need to compensate for this situation.

While here, fix a minor longstanding bug that empty tar archives
(which begin with at least 512 zero bytes) never properly reported
their format.  In particular, this fixes the output of:
   bsdtar tvvf /dev/zero

And, of course, a new test to verify that libarchive correctly
recognizes the format of such files.

16 years ago* Remove KTR_CPUMASK, it is not correct to set this
kris [Sun, 13 Jan 2008 22:46:24 +0000 (22:46 +0000)]
* Remove KTR_CPUMASK, it is not correct to set this

* Explain why 32768 entries is usually not enough

* Increase the scaling ratio to 10 to deal with 32-bit overflows that
  can occur in calculating the canvas offsets

16 years agoConvert over to using the multiqueue infrastructure although all calls going
kmacy [Sun, 13 Jan 2008 22:38:17 +0000 (22:38 +0000)]
Convert over to using the multiqueue infrastructure although all calls going
through cxgb_start still end up using queue 0

16 years agoAdd buf_ring_full utility function, make sure dequeue/enqueue see the latest
kmacy [Sun, 13 Jan 2008 22:37:09 +0000 (22:37 +0000)]
Add buf_ring_full utility function, make sure dequeue/enqueue see the latest
indexes