]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years ago- Add myself to committers-ports.dot
wen [Mon, 13 Dec 2010 08:56:30 +0000 (08:56 +0000)]
- Add myself to committers-ports.dot

13 years agosh: Various simplifications to jobs.c:
jilles [Sun, 12 Dec 2010 22:59:34 +0000 (22:59 +0000)]
sh: Various simplifications to jobs.c:
* Prefer kill(-X) to killpg(X).
* Remove some dead code.
* No additional SIGINT is needed if int_pending() is already true.

No functional change is intended.

13 years agoRemove the advertising clause from UCB copyrighted files in sbin. This
joel [Sun, 12 Dec 2010 21:26:12 +0000 (21:26 +0000)]
Remove the advertising clause from UCB copyrighted files in sbin.  This
is in accordance with the information at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

13 years agosh: Fix some tests that used sh instead of ${SH}
jilles [Sun, 12 Dec 2010 21:18:16 +0000 (21:18 +0000)]
sh: Fix some tests that used sh instead of ${SH}
so they tested the wrong sh.

This was caused because these tests were committed after the sh -> ${SH}
change but were created before.

13 years agoBugfix: Do correct accounting using the MIB counters when an
tuexen [Sun, 12 Dec 2010 20:50:44 +0000 (20:50 +0000)]
Bugfix: Do correct accounting using the MIB counters when an
        association is aborted via sctp_abort_association().

MFC after: 3 days.

13 years agosh: Add a test for r216387 (long arithmetic expression in here document).
jilles [Sun, 12 Dec 2010 16:56:16 +0000 (16:56 +0000)]
sh: Add a test for r216387 (long arithmetic expression in here document).

13 years agoIn fpudna()/npxdna(), mark FPU context initialized and optionally
kib [Sun, 12 Dec 2010 16:16:39 +0000 (16:16 +0000)]
In fpudna()/npxdna(), mark FPU context initialized and optionally
mark user FPU context initialized, if current context is user context.
It was reversed in r215865, by inadequate change of this code fragment
to a call to fpuuserinited()/npxuserinited().

The issue is only relevant for in-kernel users of FPU.

Reported by: Jan Henrik Sylvester <me janh de>, Mike Tancsa <mike sentex net>
Tested by: Mike Tancsa
MFC after: 3 days

13 years agoAdd regression test for new NFSv4 ACL semantics, verified with ZFSv28.
trasz [Sun, 12 Dec 2010 13:04:30 +0000 (13:04 +0000)]
Add regression test for new NFSv4 ACL semantics, verified with ZFSv28.
Note that to run it, you need not only ZFSv28, but also a modified setfacl(1),
which is not in the tree yet.

13 years agoHandle the special ruleset 0 in devfs_ruleset_use(). An attempt set the
jh [Sun, 12 Dec 2010 08:52:13 +0000 (08:52 +0000)]
Handle the special ruleset 0 in devfs_ruleset_use(). An attempt set the
current ruleset to 0 with command "devfs ruleset 0" triggered a KASSERT
in devfs_ruleset_create().

PR: kern/125030
Submitted by: Mateusz Guzik

13 years agoI2C drivers for XLR/XLS processors.
jchandra [Sun, 12 Dec 2010 06:00:26 +0000 (06:00 +0000)]
I2C drivers for XLR/XLS processors.

- Major update to xlr_i2c.c: do multi-byte ops correctly, remove unnecessary
  code, add mutex to protect bus operations, style(9) fixes.
- Drivers for I2C devices on XLR/XLS engineering boards, ds1374u RTC, max6657
  temparature sensor and at24co2n EEPROM.

Submitted by: Sreekanth M. S. (kanthms at netlogicmicro com)

13 years agosh: Remove the herefd hack.
jilles [Sun, 12 Dec 2010 00:07:27 +0000 (00:07 +0000)]
sh: Remove the herefd hack.

The herefd hack wrote out partial here documents while expanding them. It
seems unnecessary complication given that other expansions just allocate
memory. It causes bugs because the stack is also used for intermediate
results such as arithmetic expressions. Such places should disable herefd
for the duration but not all of them do, and I prefer removing the need for
disabling herefd to disabling it everywhere needed.

Here documents larger than 1024 bytes will use a bit more CPU time and
memory.

Additionally this allows a later change to expand here documents in the
current shell environment. (This is faster for small here documents but also
changes behaviour.)

Obtained from: dash

13 years agoReduce the Xen timecounter from 1GHz to 2^-9 GHz, thereby increasing the
cperciva [Sat, 11 Dec 2010 22:33:33 +0000 (22:33 +0000)]
Reduce the Xen timecounter from 1GHz to 2^-9 GHz, thereby increasing the
timecounter period from 2^32 ns (~4.3s) to 2^41 ns (~36m39s).  Some time
sharing systems can skip clock interrupts for a few seconds when under
load (e.g., if we've recently used more than our fair share of CPU and
someone else wants a burst of CPU) and we were losing time in quanta of
2^32 ns due to timecounter wrapping.

Increasing the timecounter period up to 2^41 ns is definitely overkill,
but we still have microsecond timecounter precision, and anyone using
paravirtualized hardware when they need submicrosecond timing is crazy.

13 years agosh: Replace some macros and repeated code in expand.c with functions.
jilles [Sat, 11 Dec 2010 22:13:29 +0000 (22:13 +0000)]
sh: Replace some macros and repeated code in expand.c with functions.

No functional change is intended, but the binary is about 1K smaller on
i386.

13 years agoAdd some isync()s related to the 64-bit MMU scratch page to avoid race
nwhitehorn [Sat, 11 Dec 2010 20:29:52 +0000 (20:29 +0000)]
Add some isync()s related to the 64-bit MMU scratch page to avoid race
conditions on its invalidation.

13 years agoMake the machdep.independent_wallclock sysctl do what it says on the box.
cperciva [Sat, 11 Dec 2010 20:12:42 +0000 (20:12 +0000)]
Make the machdep.independent_wallclock sysctl do what it says on the box.

13 years agoFix stack alignment (required to be to 16 bytes) instead of ptrace and
nwhitehorn [Sat, 11 Dec 2010 17:57:42 +0000 (17:57 +0000)]
Fix stack alignment (required to be to 16 bytes) instead of ptrace and
cerror on powerpc64.

13 years agosh: Use vsnprintf() rather than crafting our own in fmtstr().
jilles [Sat, 11 Dec 2010 17:47:27 +0000 (17:47 +0000)]
sh: Use vsnprintf() rather than crafting our own in fmtstr().
Add INTOFF/INTON as longjmp out of vsnprintf may cause memory leaks or
undefined behaviour.

13 years agoAllow to specify path to a file we want to test with sendfile(2).
pjd [Sat, 11 Dec 2010 16:06:52 +0000 (16:06 +0000)]
Allow to specify path to a file we want to test with sendfile(2).
This allows to specify selected file system and not only /tmp/.

13 years agoRemove redundant semicolon and empty like.
pjd [Sat, 11 Dec 2010 13:35:25 +0000 (13:35 +0000)]
Remove redundant semicolon and empty like.

13 years agoRemove unnecessary debug/error CFLAGS.
syrinx [Sat, 11 Dec 2010 13:24:01 +0000 (13:24 +0000)]
Remove unnecessary debug/error CFLAGS.

Reported by : pawel.worach (at) gmail (dot) com

13 years agoacpi_fujitsu: update for P8010
avg [Sat, 11 Dec 2010 10:55:18 +0000 (10:55 +0000)]
acpi_fujitsu: update for P8010

PR: kern/121102
Submitted by: Anish Mistry <amistry@am-productions.biz>
MFC after: 3 weeks

13 years agofix atomic_set_xxx misuse in rge
avg [Sat, 11 Dec 2010 10:21:38 +0000 (10:21 +0000)]
fix atomic_set_xxx misuse in rge

It seems that atomic_set_xxx and atomic_store_xxx were confused.

Reviewed by: jhb (general issue)
MFC after: 3 weeks

13 years agofix atomic_set_xxx misuse in drm
avg [Sat, 11 Dec 2010 10:18:05 +0000 (10:18 +0000)]
fix atomic_set_xxx misuse in drm

It seems that atomic_set_xxx and atomic_store_xxx were confused.

Reviewed by: jhb
MFC after: 3 weeks

13 years agofix incorrect use of atomic_set_xxx in cxgb
avg [Sat, 11 Dec 2010 10:14:08 +0000 (10:14 +0000)]
fix incorrect use of atomic_set_xxx in cxgb

There is no need to use an atomic operation at structure initialization
time.
Note that the file changed is not connected to the build at this time.

Reviewed by: jhb (general issue)
Approved by: np
MFC after: 2 weeks

13 years agoRemove the advertising clause from UCB copyrighted files in usr.sbin. This
joel [Sat, 11 Dec 2010 09:38:12 +0000 (09:38 +0000)]
Remove the advertising clause from UCB copyrighted files in usr.sbin.  This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

13 years agoFix race in devfs by using LIST_FIRST() instead of
hselasky [Sat, 11 Dec 2010 08:44:10 +0000 (08:44 +0000)]
Fix race in devfs by using LIST_FIRST() instead of
LIST_FOREACH_SAFE() when freeing the devfs private
data entries.

Reviewed by: kib
MFC after: 3 days
Approved by: thompsa (mentor)

13 years agoRemove the advertising clause from UCB copyrighted files in usr.bin. This
joel [Sat, 11 Dec 2010 08:32:16 +0000 (08:32 +0000)]
Remove the advertising clause from UCB copyrighted files in usr.bin.  This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson

13 years agoThe use of snprintf() to append to a buffer is not valid according to C99
kevlo [Sat, 11 Dec 2010 08:07:21 +0000 (08:07 +0000)]
The use of snprintf() to append to a buffer is not valid according to C99

13 years agoFix setting LUN numbers in the mps(4) driver.
ken [Sat, 11 Dec 2010 00:36:35 +0000 (00:36 +0000)]
Fix setting LUN numbers in the mps(4) driver.

Prior to this change, the addressing method wasn't getting set, and
so the LUN field could be set incorrectly in some instances.

This fix should allow for LUN numbers up to 16777215 (and return an error
for anything larger, which wouldn't fit into the flat addressing model).

Submitted by: scottl (in part)

13 years agoDerive the XENHVM kernel from GENERIC, adding only the options required
rwatson [Fri, 10 Dec 2010 22:22:01 +0000 (22:22 +0000)]
Derive the XENHVM kernel from GENERIC, adding only the options required
to support PV drivers (such as xenpci), and non-adptive locking (along
with a comment about why).

This change eliminates the synchronisation problem between GENERIC and
XENHVM, which had become severely rotted in HEAD, and in 8-STABLE
included non-production kernel debugging features such as WITNESS.

However, it comes at the cost of enabling devices and options that may
not be present under Xen (such as random ethernet cards).  For now, opt
for a simpler kernel configuration file rather than using nooptions/
nodevice to enumerate and eliminate them.  This leads to a somewhat
larger XENHVM kernel.

This is an MFC candidate for 8-STABLE before 8.2, in order to provide
a production-worthy XENHVM kernel configuration for amd64.

Discussed with: gibbs, cperciva
Reported by: Piete Brooks <Piete.Brooks at cl.cam.ac.uk>
Sponsored by: DARPA, AFRL
MFC after: 3 days

13 years agoImplement more of __ibsta: END and SRQI status bits (taken out of the
joerg [Fri, 10 Dec 2010 22:20:11 +0000 (22:20 +0000)]
Implement more of __ibsta: END and SRQI status bits (taken out of the
uPD7210 IRQ status).

MFC after: 1 week

13 years agoFix an event handling bug with the mps(4) driver.
ken [Fri, 10 Dec 2010 21:45:10 +0000 (21:45 +0000)]
Fix an event handling bug with the mps(4) driver.

This bug manifested itself after repeated device arrivals and
departures.  The root of the problem was that the last entry in the
reply array wasn't initialized/allocated.  So every time we got
around to that event, we had a bogus address.

There were a couple more problems with the code that are also fixed:

 - The reply mechanism was being treated as sequential (indexed by
   sc->replycurindex) even though the spec says that the driver
   should use the ReplyFrameAddress field of the post queue
   descriptor to figure out where the reply is.  There is no
   guarantee that the reply descriptors will be used in sequential
   order.

 - The second word of the reply post queue descriptor wasn't being
   checked in mps_intr_locked() to make sure that it wasn't
   0xffffffff.  So the driver could potentially come across a
   partially DMAed descriptor.

 - The number of replies allocated was one less than the actual
   size of the queue.  Instead, it was the size of the number of
   replies that can be used at one time.  (Which is one less than
   the size of the queue.)

mps.c: When initializing the entries in the reply free
queue, make sure we initialize the full number that
we tell the chip we have (sc->fqdepth), not the
number that can be used at any one time (sc->num_replies).

When allocating replies, make sure we allocate the
number of replies that we've told the chip exist,
not just the number that can be used simultaneously.

Use the ReplyFrameAddress field of the post queue
descriptor to figure out which reply is being
referenced.  This is what the spec says to do, and
the spec doesn't guarantee that the replies will be
used in order.

Put a check in to verify that the reply address passed
back from the card is valid.  (Panic if it isn't, we'll
panic when we try to deference the reply pointer in any
case.)

In mps_intr_locked(), verify that the second word of the
post queue descriptor is not 0xffffffff in addition to
verifying that the unused flag is not set, so we can
make sure we didn't get a partially DMAed descriptor.

Remove references to sc->replycurindex, it isn't needed
now.

mpsvar.h: Remove replycurindex from the softc, it isn't needed now.

Reviewed by: scottl

13 years agoRemove unecessary and clearly wrong usage of atomic(9).
yongari [Fri, 10 Dec 2010 21:43:20 +0000 (21:43 +0000)]
Remove unecessary and clearly wrong usage of atomic(9).

Reported by: avg, jhb, attilio

13 years agoFix a few issues related to the XPT_GDEV_ADVINFO CCB.
ken [Fri, 10 Dec 2010 21:38:51 +0000 (21:38 +0000)]
Fix a few issues related to the XPT_GDEV_ADVINFO CCB.

camcontrol.c: In buildbusdevlist(), don't attempt to get call
getdevid() for an unconfigured device, even when the
verbose flag is set.  The cam_open_btl() call will almost
certainly fail.

Probe for the buffer size when issuing the XPT_GDEV_ADVINFO
CCB.  Probing for the buffer size first helps us avoid
allocating the maximum buffer size when it really may not
be necessary.  This also helps avoid errors from
cam_periph_mapmem() if we attempt to map more than MAXPHYS.

cam_periph.c: In cam_periph_mapmem(), if the XPT_GDEV_ADVINFO CCB
shows a bufsiz of 0, we don't have anything to map,
so just return.

Also, set the maximum mapping size to MAXPHYS
instead of DFLTPHYS for XPT_GDEV_ADVINFO CCBs,
since they don't actually go down to the hardware.

scsi_pass.c: Don't bother mapping the buffer in XPT_GDEV_ADVINFO
CCBs if bufsiz is 0.

13 years agoOn the Xserve G5 we find the LM75 instead of the DS1775. The core
andreast [Fri, 10 Dec 2010 20:27:50 +0000 (20:27 +0000)]
On the Xserve G5 we find the LM75 instead of the DS1775. The core
functionality is the same, a difference is that the DS1775 has a better
precision than the LM75. But we do not use it in our setup. Make the
LM75 work the same as the DS1775.

Fix a typo in device_set_desc.

Tested by: Paul Mather <paul at gromit dlib vt edu>

Approved by: nwhitehorn (mentor)

13 years agoUse SYS_RES_IOPORT instead of PCIM_CMD_PORTEN when calling pci_enable_io.
tijl [Fri, 10 Dec 2010 15:05:49 +0000 (15:05 +0000)]
Use SYS_RES_IOPORT instead of PCIM_CMD_PORTEN when calling pci_enable_io.

Approved by: kib (mentor)

13 years agoFix __retval vs. retval confusion: retval is meant to store the (userland)
joerg [Fri, 10 Dec 2010 14:04:41 +0000 (14:04 +0000)]
Fix __retval vs. retval confusion: retval is meant to store the (userland)
pointer where data is to be returned by ibask() (currently unimplemented),
while __retval holds the value returned by the libgpib ibfoo() functions.

The confusion resulted in the ibfoo() functions returning an uninitialized
value except in situations where the GPIB activity has been terminated
abnormally.

MFC after: 3 days

13 years agoAdd a .note.ABI-tag section to ia64 startup files by linking crtbrand.c
tijl [Fri, 10 Dec 2010 08:53:06 +0000 (08:53 +0000)]
Add a .note.ABI-tag section to ia64 startup files by linking crtbrand.c
in crt1.o. On other architectures crtbrand.c is included from crt1.c,
but that's not a C source code file on ia64. Instead it is compiled
separately and included in crt1.o using incremental linking.

Tested by: dim (previous version)
Approved by: kib (mentor)

13 years agoRefactor fork1() to make it easier to follow. No functional changes.
trasz [Fri, 10 Dec 2010 08:33:56 +0000 (08:33 +0000)]
Refactor fork1() to make it easier to follow.  No functional changes.

Reviewed by: kib (earlier version)
Tested by: pho

13 years agoDocument this driver supports the converter I just bought.
ru [Fri, 10 Dec 2010 07:55:38 +0000 (07:55 +0000)]
Document this driver supports the converter I just bought.

13 years agoBring in the change from OpenBSD's 1.14:
dougb [Thu, 9 Dec 2010 23:57:23 +0000 (23:57 +0000)]
Bring in the change from OpenBSD's 1.14:

"synchronize synopsis and usage; "-l", "-r", "-s" and "-x" are mutually
exclusive; while here, slightly improve spacing in the source code
so it fits on a 80-column display again.

diff greatly improved by martynas@"

Obtained from: sobrado@OpenBSD.org

13 years agoDon't tie ct_debug to bootverbose. Provide a sysctl to turn it on or off.
bz [Thu, 9 Dec 2010 22:02:48 +0000 (22:02 +0000)]
Don't tie ct_debug to bootverbose.  Provide a sysctl to turn it on or off.
Switch the default to always off.

Reviewed by: kib

13 years agoLet all .c and .S files under lib/csu consistently use the __FBSDID()
dim [Thu, 9 Dec 2010 21:31:21 +0000 (21:31 +0000)]
Let all .c and .S files under lib/csu consistently use the __FBSDID()
macro for identification, instead of several different hand-rolled
variants (plain .ident, .ascii, etc).

13 years agoRemove AMD Family 0Fh, Model 6Bh, Stepping 2 from the list of P-state
jkim [Thu, 9 Dec 2010 21:29:36 +0000 (21:29 +0000)]
Remove AMD Family 0Fh, Model 6Bh, Stepping 2 from the list of P-state
invariant CPUs.  I do not believe this model is P-state invariant any more.
Maybe cpufreq(4) was broken at the time of commit. :-(

13 years agoFix a long standing (from the original 4.4BSD lite sources) race between
mlaier [Thu, 9 Dec 2010 21:02:22 +0000 (21:02 +0000)]
Fix a long standing (from the original 4.4BSD lite sources) race between
vmspace_fork and vm_map_wire that would lead to "vm_fault_copy_wired: page
missing" panics.  While faulting in pages for a map entry that is being
wired down, mark the containing map as busy.  In vmspace_fork wait until the
map is unbusy, before we try to copy the entries.

Reviewed by: kib
MFC after: 5 days
Sponsored by: Isilon Systems, Inc.

13 years agoWhen reopening a stream backed by an open file descriptor, do not close
jhb [Thu, 9 Dec 2010 20:28:30 +0000 (20:28 +0000)]
When reopening a stream backed by an open file descriptor, do not close
the existing file descriptor.  Instead, let dup2() atomically close the
old file descriptor when assigning the newly opened file to the same
descriptor.  This closes a race in a multithreaded application where a
concurrent open() could allocate the existing file descriptor in between
the calls to close() and dup2().

PR: threads/79887
Submitted by: Dmitrij Tejblum  tejblum of yandex-team.ru
Reviewed by: davidxu
MFC after: 1 week

13 years agoWhen r207410 eliminated the acquisition and release of the page queues
alc [Thu, 9 Dec 2010 20:16:00 +0000 (20:16 +0000)]
When r207410 eliminated the acquisition and release of the page queues
lock from pmap_extract_and_hold(), it didn't take into account that
pmap_pte_quick() sometimes requires the page queues lock to be held.
This change reimplements pmap_extract_and_hold() such that it no
longer uses pmap_pte_quick(), and thus never requires the page queues
lock.

For consistency, adopt the same idiom as used by the new
implementation of pmap_extract_and_hold() in pmap_extract() and
pmap_mincore().  It also happens to make these functions shorter.

Fix a style error in pmap_pte().

Reviewed by: kib@

13 years agoDisable attempts to establish a callback connection from the
rmacklem [Thu, 9 Dec 2010 19:02:23 +0000 (19:02 +0000)]
Disable attempts to establish a callback connection from the
experimental NFSv4 server to a NFSv4 client when delegations are not
being issued, even if the client advertises a callback path.
This avoids a problem where a Linux client advertises a
callback path that doesn't work, due to a firewall, and then
times out an Open attempt before the FreeBSD server gives up
its callback connection attempt. (Suggested by
drb at karlov.mff.cuni.cz to fix the Linux client problem that
he reported on the fs-stable mailing list.)
The server should probably have
a 1sec timeout on callback connection attempts when there are
no delegations issued to the client, but that patch will require
changes to the krpc and this serves as a work around until then.

Tested by: drb at karlov.mff.cuni.cz
MFC after: 5 days

13 years agoFix compilation when DEBUG option is enabled.
jchandra [Thu, 9 Dec 2010 12:30:13 +0000 (12:30 +0000)]
Fix compilation when DEBUG option is enabled.

- remove unused code in mips/rmi/xlr_pci.c
- remove unused variable in mips/rmi/dev/nlge/if_nlge.c
- fix reference to old function in mips/mips/pmap.c

Reported by: Prabhath Raman (prabhath at netlogicmicro com)

13 years agoUnbreak "make installworld" w/ DESTDIR specified
syrinx [Thu, 9 Dec 2010 12:25:45 +0000 (12:25 +0000)]
Unbreak "make installworld" w/ DESTDIR specified

PR : kern/152939

13 years agoBuild sade on amd64 as well as i386 and sparc64.
brucec [Thu, 9 Dec 2010 11:37:40 +0000 (11:37 +0000)]
Build sade on amd64 as well as i386 and sparc64.

13 years agoClosing fd when it's done
kevlo [Thu, 9 Dec 2010 08:36:23 +0000 (08:36 +0000)]
Closing fd when it's done

Reviewed by: sbruno

13 years ago- dump_avail layout should be sequence of [start, end)
gonzo [Thu, 9 Dec 2010 07:47:40 +0000 (07:47 +0000)]
- dump_avail layout should be sequence of [start, end)
    pairs, not <start, size>.

Spotted by: alc@

13 years agoRevert the vm/vm_page.c change in r216317.
jchandra [Thu, 9 Dec 2010 07:39:06 +0000 (07:39 +0000)]
Revert the vm/vm_page.c change in r216317.

This adds back changes in r216141, which was reverted by the above
check in.

13 years ago- Populate dump_avail with proper values from phys_avail
gonzo [Thu, 9 Dec 2010 07:01:03 +0000 (07:01 +0000)]
- Populate dump_avail with proper values from phys_avail

13 years agoswi_vm() for mips.
jchandra [Thu, 9 Dec 2010 06:54:06 +0000 (06:54 +0000)]
swi_vm() for mips.

13 years agoReplace i386/i386/busdma_machdep.c and amd64/amd64/busdma_machdep.c
cperciva [Thu, 9 Dec 2010 06:41:50 +0000 (06:41 +0000)]
Replace i386/i386/busdma_machdep.c and amd64/amd64/busdma_machdep.c
(which are identical) with a single x86/x86/busdma_machdep.c.

13 years agoUMA_MD_SMALL_ALLOC for mips.
jchandra [Thu, 9 Dec 2010 06:34:28 +0000 (06:34 +0000)]
UMA_MD_SMALL_ALLOC for mips.

Implement uma_small_alloc() and uma_small_free() for mips that allocates
pages from direct mapped memory. Uses the same mechanism as the page table
page allocator, so that we allocate from KSEG0 in 32 bit, and from XKPHYS
on 64 bit.

Reviewed by: alc, jmallett

13 years agoMFp4:
davidxu [Thu, 9 Dec 2010 05:16:20 +0000 (05:16 +0000)]
MFp4:
The unit number allocator reuses ID too fast, this may hide bugs in
other code, add a ring buffer to delay freeing a thread ID.

13 years agoMFp4:
davidxu [Thu, 9 Dec 2010 02:42:02 +0000 (02:42 +0000)]
MFp4:
It is possible a lower priority thread lending priority to higher priority
thread, in old code, it is ignored, however the lending should always be
recorded, add field td_lend_user_pri to fix the problem, if a thread does
not have borrowed priority, its value is PRI_MAX.

MFC after: 1 week

13 years agoDo not subtract 0.5% from estimated frequency if DELAY(9) is driven by TSC.
jkim [Wed, 8 Dec 2010 23:40:41 +0000 (23:40 +0000)]
Do not subtract 0.5% from estimated frequency if DELAY(9) is driven by TSC.
Remove a confusing comment about converting to MHz as we never did.

13 years agoprintf: Test that the "--" option terminator works.
jilles [Wed, 8 Dec 2010 22:54:18 +0000 (22:54 +0000)]
printf: Test that the "--" option terminator works.

13 years agoprintf: Remove support for building as a csh builtin.
jilles [Wed, 8 Dec 2010 22:13:27 +0000 (22:13 +0000)]
printf: Remove support for building as a csh builtin.

The #define BUILTIN was for building as a csh (not tcsh) builtin.
Given that csh was replaced by tcsh years ago there is no point in keeping
this.

The #define SHELL is for building as an sh builtin and is in active use.

This commit does not change the /bin/sh and /usr/bin/printf binaries.

13 years agoAdd IDs of HighPoint RocketRAID 62x cards (Marvell 88SE9128 chips).
mav [Wed, 8 Dec 2010 20:35:20 +0000 (20:35 +0000)]
Add IDs of HighPoint RocketRAID 62x cards (Marvell 88SE9128 chips).

PR: kern/152926
Submitted by: Mike Tancsa <mike@sentex.net>
MFC after: 1 week

13 years agoOn amd64, we have (since r1.72, in December 2005) MAX_BPAGES=8192,
cperciva [Wed, 8 Dec 2010 20:20:10 +0000 (20:20 +0000)]
On amd64, we have (since r1.72, in December 2005) MAX_BPAGES=8192,
while on i386 we have MAX_BPAGES=512.  Implement this difference via
'#ifdef __i386__'.

With this commit, the i386 and amd64 busdma_machdep.c files become
identical; they will soon be replaced by a single file under sys/x86.

13 years agoMFi386 r1.94: If XEN, make pmap_kextract = pmap_kextract_ma. This is a
cperciva [Wed, 8 Dec 2010 19:52:04 +0000 (19:52 +0000)]
MFi386 r1.94: If XEN, make pmap_kextract = pmap_kextract_ma.  This is a
no-op currently, since FreeBSD/amd64 doesn't have (paravirtualized) Xen
support, but if/when that support is ever added we'll want this, and
until then it's harmless.

13 years agoMFi386 r1.81, r1.82, r1.84: Reorganize code to reduce cache pressure and
cperciva [Wed, 8 Dec 2010 19:42:21 +0000 (19:42 +0000)]
MFi386 r1.81, r1.82, r1.84: Reorganize code to reduce cache pressure and
branch mispredictions.

No objections from: scottl

13 years agoFix typos.
syrinx [Wed, 8 Dec 2010 17:34:07 +0000 (17:34 +0000)]
Fix typos.

13 years agoAdd (disabled) sample configurations needed to enable the snmp_usm and
syrinx [Wed, 8 Dec 2010 17:27:59 +0000 (17:27 +0000)]
Add (disabled) sample configurations needed to enable the snmp_usm and
snmp_vacm modules and minimal user/view configurations needed to for
the modules to work properly.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    philip@ (mostly)
Approved by:    philip@

13 years agoAdd a forgotten file from r216294 and unbreak the build.
syrinx [Wed, 8 Dec 2010 15:52:06 +0000 (15:52 +0000)]
Add a forgotten file from r216294 and unbreak the build.

Sponsored by: The FreeBSD Foundation
Reviewed by: philip@ (mostly)
Approved by: philip@

13 years agoUse convenience macro for minimum and maximum value capping when
attilio [Wed, 8 Dec 2010 15:32:54 +0000 (15:32 +0000)]
Use convenience macro for minimum and maximum value capping when
re-arming the watchdog timeout.

Sponsored by: Sandvine Incorporated
Submitted by: Mark Johnston <mjohnston at sandvine dot com>
Reviewed by: des
MFC after: 10 days

13 years ago- Fix array bounds checking. [1]
glebius [Wed, 8 Dec 2010 15:12:37 +0000 (15:12 +0000)]
- Fix array bounds checking. [1]
- Add message length checking.

PR: 151664 [1]
Submitted by: Alexey Illarionov <littlesavage rambler.ru> [1]
Reviewed by: yar

13 years agoAdd RTM_IEEE80211 to array of route message descriptions.
glebius [Wed, 8 Dec 2010 15:10:27 +0000 (15:10 +0000)]
Add RTM_IEEE80211 to array of route message descriptions.

PR: 151664
Submitted by: Alexey Illarionov <littlesavage rambler.ru>

13 years agoAdd bsnmpd(1)'s SNMP client tools (including SNMPv3 support) to the base system.
syrinx [Wed, 8 Dec 2010 14:30:25 +0000 (14:30 +0000)]
Add bsnmpd(1)'s SNMP client tools (including SNMPv3 support) to the base system.

Sponsored by:   The FreeBSD Foundation (the SNMPv3 bits), Google Summer of Code 2005
Reviewed by:    philip@ (mostly), bz@ (earlier version based on p4 ch124545)
Approved by:    philip@

13 years agoIn bsnmpd(1) add support for SNMPv3 message processing model, including message authe...
syrinx [Wed, 8 Dec 2010 13:51:38 +0000 (13:51 +0000)]
In bsnmpd(1) add support for SNMPv3 message processing model, including message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415).

Sponsored by: The FreeBSD Foundation
Reviewed by: philip@ (mostly)
Approved by: philip@

13 years agoPrint message with information about updating the boot code if a new
mm [Wed, 8 Dec 2010 13:51:25 +0000 (13:51 +0000)]
Print message with information about updating the boot code if a new
vdev is attached to a root pool (e.g. when creating a mirrored boot pool).

Reviewed by: pav
Approved by: delphij (mentor)
MFC after: 3 days

13 years agoClose fd in initattr() and showattr().
kevlo [Wed, 8 Dec 2010 10:27:07 +0000 (10:27 +0000)]
Close fd in initattr() and showattr().

Reviewed by: rwatson

13 years agoDo not print OpenSolaris hint to use (non-existing) installgrub(1) command
mm [Wed, 8 Dec 2010 08:57:37 +0000 (08:57 +0000)]
Do not print OpenSolaris hint to use (non-existing) installgrub(1) command
if creating a mirror by attaching a new vdev to a root pool.

Reported by: James R. Van Artsdalen (on freebsd-fs@freebsd.org)
Approved by: delphij (mentor)
MFC after: 3 days

13 years agoFix a typo.
hrs [Wed, 8 Dec 2010 07:10:25 +0000 (07:10 +0000)]
Fix a typo.

Submitted by: Garrett Cooper

13 years agoClosing file descriptors when it's done
kevlo [Wed, 8 Dec 2010 01:35:19 +0000 (01:35 +0000)]
Closing file descriptors when it's done

Reviewed by: np

13 years agor184610 changed the way how TX frames are handled on AX88178 and
yongari [Wed, 8 Dec 2010 01:24:05 +0000 (01:24 +0000)]
r184610 changed the way how TX frames are handled on AX88178 and
AX88772 controllers. ASIX added a new feature for AX88178/AX88772
controllers which allows combining multiple TX frames into a single
big frame. This was to overcome one of USB limitation where it
can't generate more than 8k interrupts/sec which in turn means USB
ethernet controllers can not send more than 8k packets per second.
Using ASIX's feature greatly enhanced TX performance(more than 3~4
times) compared to 7.x driver. However it seems r184610 removed
boundary checking for buffered frames which in turn caused
instability issues under certain conditions. In addition, using
ASIX's feature triggered another issue which made USB controller
hang under certain conditions. Restarting ethernet controller
didn't help under this hang condition and unplugging and replugging
the controller was the only solution. I believe there is a silicon
bug in TX frame combining feature on AX88178/AX88772 controllers.

To address these issues, reintroduce the boundary checking for both
AX88178 and AX88772 after copying a frame to USB buffer and do not
use ASIX's multiple frame combining feature. Instead, use USB
controller's multi-frame transmit capability to enhance TX
performance as suggested by Hans[1].
This should fix a long standing axe(4) instability issues reported
on AX88772 and AX88178 controllers. While I'm here remove
unnecessary TX frame length check since upper stack always
guarantee the size of a frame to be less than MCLBYTES.

Special thanks to Derrick Brashear who tried numerous patches
during last 4 months and waited real fix with patience. Without
this enthusiastic support, patience and H/W donation I couldn't fix
it since I was not able to trigger the issue on my box.

Suggested by: hselasky [1]
Tested by: Derrick Brashear (shadow <> gmail dot com>
H/W donated by: Derrick Brashear (shadow <> gmail dot com>
PR: usb/140883

13 years agoMerge sys/amd64/amd64/tsc.c and sys/i386/i386/tsc.c and move to sys/x86/x86.
jkim [Wed, 8 Dec 2010 00:09:24 +0000 (00:09 +0000)]
Merge sys/amd64/amd64/tsc.c and sys/i386/i386/tsc.c and move to sys/x86/x86.

Discussed with: avg

13 years agoAdd myself to calendar.freebsd and committers-ports.dot
flo [Tue, 7 Dec 2010 23:56:51 +0000 (23:56 +0000)]
Add myself to calendar.freebsd and committers-ports.dot

Approved by: fjoe (mentor)

13 years agoPostpone the unmasking of event channels (aka. interrupts) until after
cperciva [Tue, 7 Dec 2010 23:33:20 +0000 (23:33 +0000)]
Postpone the unmasking of event channels (aka. interrupts) until after
the interrupt handlers have been registered.  NULL isn't a very good
interrupt handler.

13 years agoUse int for 'tsc_present' instead of u_int. It is just a boolean.
jkim [Tue, 7 Dec 2010 23:19:49 +0000 (23:19 +0000)]
Use int for 'tsc_present' instead of u_int.  It is just a boolean.

13 years agoLoosen the locking in nd6-free() again after r216022 to avoid
bz [Tue, 7 Dec 2010 22:43:29 +0000 (22:43 +0000)]
Loosen the locking in nd6-free() again after r216022 to avoid
a LOR and a recursed lock.

Reported by: delphij
Tested by: delphij
PR: kern/148857
MFC After: 3 days

13 years agoRemove stale comments about P-state invariant TSC and fix style(9) nits.
jkim [Tue, 7 Dec 2010 22:43:25 +0000 (22:43 +0000)]
Remove stale comments about P-state invariant TSC and fix style(9) nits.

13 years agoDo not register a event handler for CPU freqency changes when it is found
jkim [Tue, 7 Dec 2010 22:34:51 +0000 (22:34 +0000)]
Do not register a event handler for CPU freqency changes when it is found
P-state invariant.  This is continuation of r216274.

13 years agoNow the P-state invariant TSC is probed early enough, do not register event
jkim [Tue, 7 Dec 2010 22:23:26 +0000 (22:23 +0000)]
Now the P-state invariant TSC is probed early enough, do not register event
handlers for CPU freqency changes when it is found P-state invariant.
Adjust a comment about non-existent tsc_freq_max() while I am here.

13 years agoProbe P-state invariant TSC from rightful place.
jkim [Tue, 7 Dec 2010 22:12:02 +0000 (22:12 +0000)]
Probe P-state invariant TSC from rightful place.

13 years agoDon't warn if a partition appears not to be aligned on a track boundary.
brucec [Tue, 7 Dec 2010 20:46:11 +0000 (20:46 +0000)]
Don't warn if a partition appears not to be aligned on a track boundary.
Modern disks use LBA and create a fake CHS geometry that doesn't have any
relation to the on-disk layout of data.

13 years agoAdds IFF_CANTCONFIG to IFF_CANTCHANGE that it shouldn't happen through
weongyo [Tue, 7 Dec 2010 20:31:04 +0000 (20:31 +0000)]
Adds IFF_CANTCONFIG to IFF_CANTCHANGE that it shouldn't happen through
ioctl(2).

13 years agoIntroduces IFF_CANTCONFIG interface flag to point that the interface
weongyo [Tue, 7 Dec 2010 20:23:47 +0000 (20:23 +0000)]
Introduces IFF_CANTCONFIG interface flag to point that the interface
isn't configurable in a meaningful way.  This is for ifconfig(8) or
other tools not to change code whenever IFT_USB-like interfaces are
registered at the interface list.

Reviewed by: brooks
No objections: gavin, jkim

13 years agoAdd a comment to clarify that some BIOSes may clear the hw watchdog
emaste [Tue, 7 Dec 2010 19:18:00 +0000 (19:18 +0000)]
Add a comment to clarify that some BIOSes may clear the hw watchdog
indicator bit, preventing us from reporting in that case.

X-MFC-with: r215868

13 years agoUse proper resource ID's for HPET IRQ resources. This mostly consists of
jhb [Tue, 7 Dec 2010 18:49:11 +0000 (18:49 +0000)]
Use proper resource ID's for HPET IRQ resources.  This mostly consists of
looking to see if there is an existing IRQ resource for a given IRQ
provided by the BIOS and using that RID if so.  Otherwise, allocate a new
RID for the new IRQ.

Reviewed by: mav (a while ago)

13 years agoDon't write data into an empty "file."
kientzle [Tue, 7 Dec 2010 16:48:01 +0000 (16:48 +0000)]
Don't write data into an empty "file."

In particular, this check avoids a warning when
extracting directory entries from certain GNU tar
archives that store directory contents.

MFC after: 3 days

13 years agoUse a "push" strategy to get data through libz, rather than a "pull" strategy.
phk [Tue, 7 Dec 2010 16:30:52 +0000 (16:30 +0000)]
Use a "push" strategy to get data through libz, rather than a "pull" strategy.

13 years agoUndo r216230: the interaction between saved ashift in metadata and
ivoras [Tue, 7 Dec 2010 15:24:08 +0000 (15:24 +0000)]
Undo r216230: the interaction between saved ashift in metadata and
detected ashift does not support this. With this change, pools
created while stripesize=512 could not be imported when stripesize
becomes larger (on the same drive).

Noticed by: pjd

13 years agoUpdate some comments related to use of amd64 full context switch.
kib [Tue, 7 Dec 2010 12:44:33 +0000 (12:44 +0000)]
Update some comments related to use of amd64 full context switch.
In exec_linux_setregs(), use locally cached pointer to pcb to set
pcb_full_iret.
In set_regs(), note that full return is needed when code that sets
segment registers is enabled.

MFC after: 1 week

13 years agoopensolaris cyclic: fix deadlock and make a little bit closer to upstream
avg [Tue, 7 Dec 2010 12:25:26 +0000 (12:25 +0000)]
opensolaris cyclic: fix deadlock and make a little bit closer to upstream

The dealock was caused in the following way:
- thread T1 on CPU C1 holds a spin mutex, IPIs CPU C2 and waits for the
  IPI to be handled
- C2 executes timer interrupt filter, thus has interrupts disabled, and
  gets blocked on the spin mutex held by T1
The problem seems to have been introduced by simplifications made to
OpenSolaris code during porting.
The problem is fixed by reorganizing the code to more closely resemble
the upstream version.  Interrupt filter (cyclic_fire) now doesn't
acquire any locks, all per-CPU data accesses are performed on a
target CPU with preemption and interrupts disabled thus precluding
concurrent access to the data.
cyp_mtx spin mutex is used to disable preemtion and interrupts; it's not
used for classical mutual exclusion, because xcall already serializes
calls to a CPU.  It's an emulation of OpenSolaris
cyb_set_level(CY_HIGH_LEVEL) call, the spin mutexes could probably be
reduced to just a spinlock_enter()/_exit() pair.

Diff with upstream version is now reduced by ~500 lines, however it still
remains quite large - many things that are not needed (at the moment) or
are irrelevant on FreeBSD were simply ripped out during porting.
Examples of such things:
- support for CPU onlining/offlining
- support for suspend/resume
- support for running callouts at soft interrupt levels
- support for callout rebinding from CPU to CPU
- support for CPU partitions

Tested by: Artem Belevich <fbsdlist@src.cx>
MFC after: 3 weeks
X-MFC with: r216252