Jayachandran C. [Thu, 16 Dec 2010 04:56:03 +0000 (04:56 +0000)]
Make the ELF trampoline binary ELF executable (and do some cleanup).
- Remove the -shared flag for the trampoline binary, generate an
ELF executable instead of a shared object.
- No need to generate tmphack.S, move the code to sys/mips/mips/inckern.S
- No need generate opt_kernname.h, KERNNAME can be passed with -D
Nathan Whitehorn [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.
Bjoern A. Zeeb [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.
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.
Jaakko Heinonen [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.
Jaakko Heinonen [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.
Xin LI [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.
Jung-uk Kim [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.
Xin LI [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@.
Alan Cox [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.
Xin LI [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.
Robert Watson [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.
Robert Watson [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.
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.
Andriy Gapon [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
Rebecca Cran [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.
Robert Watson [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.
Jilles Tjoelker [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.
Joel Dahl [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
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
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.
Jaakko Heinonen [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().
Jayachandran C. [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)
Jilles Tjoelker [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.)
Colin Percival [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.
Jilles Tjoelker [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.
Joel Dahl [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
Joel Dahl [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.
Robert Watson [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
Kenneth D. Merry [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.
Kenneth D. Merry [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.
Andreas Tobler [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>
Joerg Wunsch [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.
Tijl Coosemans [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)
Doug Barton [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.
Dimitry Andric [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).
Jung-uk Kim [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. :-(
Max Laier [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.
John Baldwin [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().
Alan Cox [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.
Rick Macklem [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