]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoFix the overflowing livefs ISO by removing man pages from the HFS part of
nwhitehorn [Wed, 15 Dec 2010 23:43:25 +0000 (23:43 +0000)]
Fix the overflowing livefs ISO by removing man pages from the HFS part of
the hybrid disk. This is a stopgap until a better solution can be found,
but lets the powerpc release build complete for the time being.

MFC after: 1 week

13 years agoRename the generic "CLASS" to the more specific "GEOM_CLASS".
obrien [Wed, 15 Dec 2010 23:24:34 +0000 (23:24 +0000)]
Rename the generic "CLASS" to the more specific "GEOM_CLASS".
While I'm here remove redundancy and inconsistencies.

Obtained from: Juniper Networks

13 years agoBring back (most of) NATM to avoid further bitrot after r186119.
bz [Wed, 15 Dec 2010 22:58:45 +0000 (22:58 +0000)]
Bring back (most of) NATM to avoid further bitrot after r186119.
Keep three lines disabled which I am unsure if they had been used at all.
This will allow us to seek testers and possibly bring it all back.

Discussed with: rwatson
MFC after: 7 weeks

13 years agoOne of the compat32 functions was copying in a raw timespec, instead of
mdf [Wed, 15 Dec 2010 19:30:44 +0000 (19:30 +0000)]
One of the compat32 functions was copying in a raw timespec, instead of
a 32-bit one.  This can cause weird timeout issues, as the copying reads
garbage from the user.

Code by:     Deepak Veliath <deepak dot veliath at isilon dot com>
MFC after:   1 week

13 years agoDon't allow user created symbolic links to cover another entries marked
jh [Wed, 15 Dec 2010 16:49:47 +0000 (16:49 +0000)]
Don't allow user created symbolic links to cover another entries marked
with DE_USER. If a devfs rule hid such entry, it was possible to create
infinite number of symbolic links with the same name.

Reviewed by: kib

13 years ago- Assert that dm_lock is exclusively held in devfs_rules_apply() and
jh [Wed, 15 Dec 2010 16:42:44 +0000 (16:42 +0000)]
- Assert that dm_lock is exclusively held in devfs_rules_apply() and
  in devfs_vmkdir() while adding the entry to de_list of the parent.
- Apply devfs rules to newly created directories and symbolic links.

PR: kern/125034
Submitted by: Mateusz Guzik (original version)

13 years agoVOP_ISLOCKED() should not be used to determine if the vnode is locked.
kib [Wed, 15 Dec 2010 12:46:53 +0000 (12:46 +0000)]
VOP_ISLOCKED() should not be used to determine if the vnode is locked.
Explicitely track the locked status of the vnode.

Reviewed by: pjd
Tested by: avg
MFC after: 1 week

13 years agoAdd the missed 'p' flag to getopt() optstring argument.
kib [Wed, 15 Dec 2010 12:45:28 +0000 (12:45 +0000)]
Add the missed 'p' flag to getopt() optstring argument.

MFC after: 1 week

13 years agoFix a typo in a comment.
gibbs [Tue, 14 Dec 2010 20:57:40 +0000 (20:57 +0000)]
Fix a typo in a comment.

Noticed by: Attila Nagy <bra@fsn.hu>

13 years agoRevert r216423 per request from Jilles.
delphij [Tue, 14 Dec 2010 20:35:08 +0000 (20:35 +0000)]
Revert r216423 per request from Jilles.

The new behavior prevents us from being able to bail out explicitly
on unknown options that we have not implemented.  BASH for instance
have introduced a '-v' for printf(1) builtin and it seems to be bad
to pretend that we supported it and have a script break silently.

13 years agoStop lying about supporting cpu_est_clockrate() when TSC is invariant. This
jkim [Tue, 14 Dec 2010 20:07:51 +0000 (20:07 +0000)]
Stop lying about supporting cpu_est_clockrate() when TSC is invariant.  This
function always returned the nominal frequency instead of current frequency
because we use RDTSC instruction to calculate difference in CPU ticks, which
is supposedly constant for the case.  Now we support cpu_get_nominal_mhz()
for the case, instead.  Note it should be just enough for most usage cases
because cpu_est_clockrate() is often times abused to find maximum frequency
of the processor.

13 years agoWhen printf is being used as a sh(1) builtin, it can not call
delphij [Tue, 14 Dec 2010 18:23:15 +0000 (18:23 +0000)]
When printf is being used as a sh(1) builtin, it can not call
exit(3) as pointed out by jilles@ so revert to using return(),
also change the return value back to 1 as requested by bde@.

This is logically a revert of revision 216422.

13 years agoRemove unecessary and clearly wrong usage of atomic(9).
yongari [Tue, 14 Dec 2010 17:39:10 +0000 (17:39 +0000)]
Remove unecessary and clearly wrong usage of atomic(9).

Reported by:  avg

13 years agoRemove spurious printf left over from debugging our XenStore support.
gibbs [Tue, 14 Dec 2010 17:23:49 +0000 (17:23 +0000)]
Remove spurious printf left over from debugging our XenStore support.

13 years agoFix a memory leak on the error condition
kevlo [Tue, 14 Dec 2010 15:14:08 +0000 (15:14 +0000)]
Fix a memory leak on the error condition

Reviewed by: rpaulo

13 years agoCheck the return value of malloc().
kevlo [Tue, 14 Dec 2010 15:11:49 +0000 (15:11 +0000)]
Check the return value of malloc().

Reviewed by: hselasky
MFC after: 3 days

13 years agoSlightly different formatting for options list.
rwatson [Tue, 14 Dec 2010 10:06:28 +0000 (10:06 +0000)]
Slightly different formatting for options list.

MFC after: 3 days

13 years agoFurther refinements to the xen.4 man page: fix typos, add material on
rwatson [Tue, 14 Dec 2010 09:32:37 +0000 (09:32 +0000)]
Further refinements to the xen.4 man page: fix typos, add material on
para-virtualized drivers, clarify how to configure XENHVM on amd64.

MFC after: 3 days

13 years agoJust pass M_ZERO to malloc(9) instead of clearing allocated memory separately.
pjd [Tue, 14 Dec 2010 06:19:13 +0000 (06:19 +0000)]
Just pass M_ZERO to malloc(9) instead of clearing allocated memory separately.

13 years agoMove sysctl invocation to using a variable that's fully pathed.
gordon [Tue, 14 Dec 2010 06:07:18 +0000 (06:07 +0000)]
Move sysctl invocation to using a variable that's fully pathed.
This prevents errors for users that don't have /sbin in their PATH.

Submitted by: Max Boyarov
Approved by: mentor (wes@ implicit)

13 years agoChange memguard_fudge() so that it can handle km_max being zero. Not
alc [Tue, 14 Dec 2010 05:47:35 +0000 (05:47 +0000)]
Change memguard_fudge() so that it can handle km_max being zero.  Not
every platform defines VM_KMEM_SIZE_MAX, and on those platforms km_max
will be zero.

Reviewed by: mdf
Tested by: marius

13 years agoWe work on ctype's and not only on numbers so set LC_ALL instead of
delphij [Tue, 14 Dec 2010 01:28:33 +0000 (01:28 +0000)]
We work on ctype's and not only on numbers so set LC_ALL instead of
LC_NUMERIC.

PR: bin/152934
Submitted by: Pedro F. Giffuni <giffunip tutopia.com>
Obtained from: Illumos

13 years agoIEEE Std 1003.1-2008, Section 1.4, Utility Description Defaults says
delphij [Tue, 14 Dec 2010 01:16:56 +0000 (01:16 +0000)]
IEEE Std 1003.1-2008, Section 1.4, Utility Description Defaults says
that when the options section is listed as "None", utility shall
recognize "--" as a first argument to be discarded.

This implementation is largely based on OpenBSD implementation but
we do slightly differently:

a) We skip argv[0] as the first step;
b) We test whether the next argument is "--" and ignore it.

With this change one will get:

%printf
usage: printf format [arguments ...]
%printf -v
-v%printf -- -v
-v%
%printf --
usage: printf format [arguments ...]

Which matches the behavior observed on a Debian system but different
from the Illumos change.

13 years agoMake use of EX_USAGE for usage().
delphij [Tue, 14 Dec 2010 00:21:34 +0000 (00:21 +0000)]
Make use of EX_USAGE for usage().

13 years agoTighten up some of the comments describing turnstiles and sleepqueues.
mckusick [Mon, 13 Dec 2010 23:53:55 +0000 (23:53 +0000)]
Tighten up some of the comments describing turnstiles and sleepqueues.
No code changes.

Reviewed by: John Baldwin

13 years agoAdd a rudimentary Xen man page summarising the state of Xen on amd64 and
rwatson [Mon, 13 Dec 2010 23:30:56 +0000 (23:30 +0000)]
Add a rudimentary Xen man page summarising the state of Xen on amd64 and
i386, how to configure the kernel, and some known issues.  Further
refinement almost certainly required.  This is not a Xen installation
manual.

MFC after:      3 days
Sponsored by:   DARPA, AFRL

13 years agoAdd a rudimentary Xen man page summarising the state of Xen on amd64 and
rwatson [Mon, 13 Dec 2010 23:26:31 +0000 (23:26 +0000)]
Add a rudimentary Xen man page summarising the state of Xen on amd64 and
i386, how to configure the kernel, and some known issues.  Further
refinement almost certainly required.  This is not a Xen installation
manual.

MFC after: 3 days
Sponsored by: DARPA, AFRL

13 years agoThe only caller of mknum() provides a char instead of an int, so make it
delphij [Mon, 13 Dec 2010 19:54:42 +0000 (19:54 +0000)]
The only caller of mknum() provides a char instead of an int, so make it
match the definition.

PR: bin/152934
Submitted by: Pedro F. Giffuni <giffunip tutopia.com>
Obtained from: Illumos

13 years agoMove locale.h include to the beginning header section as pointed out by
delphij [Mon, 13 Dec 2010 19:50:12 +0000 (19:50 +0000)]
Move locale.h include to the beginning header section as pointed out by
style(9)

Submitted by: Pedro F. Giffuni <giffunip tutopia.com>

13 years agoBump manual page date.
trasz [Mon, 13 Dec 2010 19:03:10 +0000 (19:03 +0000)]
Bump manual page date.

13 years agoAfter PSARC/2010/029, "canonical six" no longer exists.
trasz [Mon, 13 Dec 2010 19:01:23 +0000 (19:01 +0000)]
After PSARC/2010/029, "canonical six" no longer exists.

13 years agoRecognize NFSv4 ACL semantics and run proper regression test.
trasz [Mon, 13 Dec 2010 18:59:55 +0000 (18:59 +0000)]
Recognize NFSv4 ACL semantics and run proper regression test.

13 years agoAdapt filesystem-independent NFSv4 ACL code (used by UFS, but not by ZFS)
trasz [Mon, 13 Dec 2010 18:56:04 +0000 (18:56 +0000)]
Adapt filesystem-independent NFSv4 ACL code (used by UFS, but not by ZFS)
to PSARC/2010/029.  In short, the semantics is simplified - "weird stuff"
no longer happens after chmod, entries don't get duplicated during
inheritance, and trivial ACLs no longer contain three "DENY" entries,
which is also more friendly to MS Windows.

By default, UFS keeps using old semantics.  To change it, set sysctl
vfs.acl_nfs4_old_semantics to 0.  I'll flip the switch when ZFSv28
hits the tree, to keep these two in sync - ZFS v28 uses PSARC semantics,
and ZFS v15 uses the old one.

13 years agoUpdates for I2C devices on XLR engg boards.
jchandra [Mon, 13 Dec 2010 17:53:38 +0000 (17:53 +0000)]
Updates for I2C devices on XLR engg boards.

- ds1374u : use multi-byte write.
- at24co2n, max6657: remove mutex, iicbus has the necessary locking.

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

13 years agoFreeBSD committer Dan Moschuk has passed away. Here is his death notice:
imp [Mon, 13 Dec 2010 16:23:02 +0000 (16:23 +0000)]
FreeBSD committer Dan Moschuk has passed away.  Here is his death notice:
http://www.lifenews.ca/thespec/profile/98251--moschuk-daniel

PR: 147479

13 years agofix mips build breakage introduced in r216375: atomic_store_int doesn't exists
avg [Mon, 13 Dec 2010 14:30:35 +0000 (14:30 +0000)]
fix mips build breakage introduced in r216375: atomic_store_int doesn't exists

1) 32-bit assignment are expected to always be atomic.
2) Release/acquire memory barrier semantics doesn't seem to be needed here.
So a simple assignment can be used.

Remove unused port_set_counter() while here, it also used to mis-use
atomic_set_int().

Reported by: jhb
Pointyhat to: avg
MFC after: 3 weeks

13 years agoUSB probing often takes a long time and finishes finding devices after init
brucec [Mon, 13 Dec 2010 13:52:03 +0000 (13:52 +0000)]
USB probing often takes a long time and finishes finding devices after init
has started. In the case of sysinstall, this means that it has already built
its list of devices before probing finishes. Add a hint for users who have
booted from a USB stick only to find that sysinstall can't find it.

MFC after: 3 days

13 years agoAdd options NO_ADAPTIVE_SX to the XENHVM kernel configuration, matching
rwatson [Mon, 13 Dec 2010 12:15:46 +0000 (12:15 +0000)]
Add options NO_ADAPTIVE_SX to the XENHVM kernel configuration, matching
its similar disabling of adaptive mutexes and rwlocks.  The existing
comment on why this is the case also applies to sx locks.

MFC after: 3 days
Discussed with: attilio

13 years agoRemove duplicate check, turning dead code into live code.
uqs [Mon, 13 Dec 2010 10:48:49 +0000 (10:48 +0000)]
Remove duplicate check, turning dead code into live code.

Coverity CID: 5114
Reviewed by: jilles

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.