ed [Sun, 25 Jan 2009 14:00:00 +0000 (14:00 +0000)]
Remove unneeded checking for invalid minor numbers from pf(4).
Because it is not possible to access the pf(4) character device through
any other device node as the one in devfs, there is no need to check for
unknown device minor numbers.
rwatson [Sun, 25 Jan 2009 12:07:43 +0000 (12:07 +0000)]
When a statically linked binary is executed (or at least, one without
an interpreter definition in its program header), set the auxiliary
ELF argument AT_BASE to 0 rather than to the address that we would
have mapped the interpreter at if there had been one.
The ELF ABI specifications appear to be ambiguous as to the desired
behavior in this situation, as they define AT_BASE as the base address
of the interpreter, but do not mention what to do if there is none.
On Solaris, AT_BASE will be set to the base address of the static
binary if there is no interpreter, and on Linux, AT_BASE is set to 0.
We go with the Linux semantics as they are of more immediate utility
and allow the early runtime environment to know that the kernel has
not mapped an interpreter, but because AT_PHDR points at the ELF
header for the running binary, it is still possible to retrieve all
required mapping information when the process starts should it be
required. Either approach would be preferable to our current behavior
of passing a pointer to an unmapped region of user memory as AT_BASE.
bz [Sun, 25 Jan 2009 10:31:45 +0000 (10:31 +0000)]
Instead of killing the 'watchdog' subshell and leaving a sleep for
rcshutdown_timeout (normally 30s) around re-parented to init, make
sure both go away using pkill -P.
While noone normally notices this for the system shutdown, it helps for
cleanly shutting down trusted jails.
Found without a killall in the base system, which in rc.d/jail normally
ensures that all processes of a jail to be stopped will be killed.
Reviewed by: silence on current@
MFC after: 4 weeks
jeff [Sun, 25 Jan 2009 09:11:24 +0000 (09:11 +0000)]
- Make the keg abstraction more complete. Permit a zone to have multiple
backend kegs so it may source compatible memory from multiple backends.
This is useful for cases such as NUMA or different layouts for the same
memory type.
- Provide a new api for adding new backend kegs to secondary zones.
- Provide a new flag for adjusting the layout of zones to stagger
allocations better across cache lines.
jeff [Sun, 25 Jan 2009 07:35:10 +0000 (07:35 +0000)]
- Use __XSTRING where I want the define to be expanded. This resulted in
sizeof("MAXCPU") being used to calculate a string length rather than
something more reasonable such as sizeof("32"). This shouldn't have
caused any ill effect until we run on machines with 1000000 or more
cpus.
thompsa [Sun, 25 Jan 2009 07:31:51 +0000 (07:31 +0000)]
If the parent up/down task was queued then sync with it before returning from
the vap ioctl. This means that the parent interface should hopefully be up
before we return to userland, it does not depend on the parent init succeeding,
just that it was run.
This fixes wpa_supplicant with ndis and USB where the parent interfaces can be
slow to init.
jeff [Sun, 25 Jan 2009 07:24:34 +0000 (07:24 +0000)]
Fix errors introduced when I rewrote select.
- Restructure selscan() and selrescan() to avoid producing extra selfps
when we have a fd in multiple sets. As described below multiple selfps
may still exist for other reasons.
- Make selrescan() tolerate multiple selfds for a given descriptor
set since sockets use two selinfos per fd. If an event on each selinfo
fires selrescan() will see the descriptor twice. This could result in
select() returning 2x the number of fds actually existing in fd sets.
ed [Sat, 24 Jan 2009 18:23:19 +0000 (18:23 +0000)]
Remove unused unrhdr from GEOM character device module.
Now that make_dev() doesn't require unit numbers to be unique, there is
no need to use an unrhdr here to generate the numbers. Remove the entire
init-routine, because it is optional.
rwatson [Sat, 24 Jan 2009 10:57:32 +0000 (10:57 +0000)]
Begin to add SDT tracing of the MAC Framework: add policy modevent,
register, and unregister hooks that give access to the mac_policy_conf
for the policy.
Obtained from: TrustedBSD Project
MFC after: 3 days
rwatson [Sat, 24 Jan 2009 10:22:49 +0000 (10:22 +0000)]
Add explicit static DTrace tracing to the callout mechanism, capturing
pointers to the callout handler just before and just after the callout
it invoked. I attempted to do this in a manner congruent to tracing in
Solaris's callout mechanism, but couldn't quite use the same names due
to convention and syntax differences.
Example DTrace script to generate a distribution graph of callout
execution times:
trhodes [Sat, 24 Jan 2009 05:32:11 +0000 (05:32 +0000)]
When "-b" is specified, one could easily create "smaller" files
that are much larger than expected (given the default size).
Change "smaller files" to "split files" which is more in line
with what "-b" actually does.
jhb [Fri, 23 Jan 2009 22:49:23 +0000 (22:49 +0000)]
- Mark all standalone INT/LONG/QUAD sysctl's MPSAFE. This is done
inside the SYSCTL() macros and thus does not need to be done for
all of the nodes scattered across the source tree.
- Mark the name-cache related sysctl's (including debug.hashstat.*) MPSAFE.
- Mark vm.loadavg MPSAFE.
- Remove GIANT_REQUIRED from vmtotal() (everything in this routine already
has sufficient locking) and mark vm.vmtotal MPSAFE.
- Mark the vm.stats.(sys|vm).* sysctls MPSAFE.
jhb [Fri, 23 Jan 2009 22:13:00 +0000 (22:13 +0000)]
Tweak the wording for vfs_mark_atime() since the I/O it is avoiding by not
updating va_atime via VOP_SETATTR() isn't always synchronous. For some
filesystems it is asynchronous.
jhb [Fri, 23 Jan 2009 22:08:54 +0000 (22:08 +0000)]
Push down Giant in the vlnru kproc main loop so that it is only acquired
around calls to vlrureclaim() on non-MPSAFE filesystems. Specifically,
vnlru no longer needs Giant for the common case of waking up and deciding
there is nothing for it to do.
jhb [Fri, 23 Jan 2009 20:53:01 +0000 (20:53 +0000)]
Only start the if_slowtimo timer (which drives the if_watchdog methods of
network interfaces) if we have at least one interface with an if_watchdog
routine.
imp [Fri, 23 Jan 2009 18:23:16 +0000 (18:23 +0000)]
Implement an idea from Sam Leffler:
make KERNFAST=blah buildkernel
is now a short cut for
make KERNCONF=blah -DKERNFAST buildkernel
This change works for all kernel config files not named "1". I did
that to make sure that
make -DKERNFAST buildkernel
remains the same as
make -DKERNFAST KERNCONF=GENERIC buildkernel
rather than trying to build and configure "1". I've never seen a
kernel config file named "1," so I think this is a good compromise.
jkim [Fri, 23 Jan 2009 17:48:18 +0000 (17:48 +0000)]
- Add few VIA bridges to agp_via.c and connect it to amd64 build
as they support Intel Core/Core 2 and VIA Nano processors.
- Align "optional agp" in conf/files.* for consistency while I am here.
weongyo [Fri, 23 Jan 2009 05:45:17 +0000 (05:45 +0000)]
Connect urtw(4) to the i386 build only because it's not tested on amd64
architecture but expect it'd work. In cases on other architectures it'd
not work yet.
keramida [Fri, 23 Jan 2009 03:46:44 +0000 (03:46 +0000)]
Add an example of using bs=2048 to duplicate data CD-ROMs.
This should be a bit useful for users who look at the manpage and
then try to copy data CD-ROM disks using dd. A lot of us know
that bs=2048 is required, but it still manages to cause a bit of
grief to those who haven't heard about it.
PR: bin/130857
Submitted by: Tri Brotoharsono < mail at tribrotoharsono.net >
MFC after: 3 days
imp [Fri, 23 Jan 2009 00:51:25 +0000 (00:51 +0000)]
Move to having a caps flag. Newer versions of the AT91 family don't
need the bouncing, so save a few copies in that case. Also convert
4-bit code selection to using it.
imp [Thu, 22 Jan 2009 22:29:21 +0000 (22:29 +0000)]
Don't over-commit the DMA. Use the passed in size of the transfer
rather than a fixed 512... This fixes the mount root problem on at91.
Prior to the SD card reorg, all data transfers were 512 bytes, so we
didn't notice.
imp [Thu, 22 Jan 2009 21:56:41 +0000 (21:56 +0000)]
Migrate towards using at91_master_clock. Initialize the clocks for
the serial port class when we set the devclass since it is now
no-longer a compile time constant. Eliminate the pci include, as it
isn't relevant or necessary.
imp [Thu, 22 Jan 2009 21:54:26 +0000 (21:54 +0000)]
Store at91_master_clock in a global variable as opposed to a compile
time constant. This allows us to potentially change it at runtime or
autodetect it early in the boot (the latter being much more likely to
have a good outcome).
jkim [Thu, 22 Jan 2009 21:04:46 +0000 (21:04 +0000)]
VIA Nano processor has a special MSR (CENT_HARDWARECTRL3) bit 32 to determine
whether TSC is P-state invariant or not. In fact, this MSR is writable but
we just leave it at the BIOS default for now.
edwin [Thu, 22 Jan 2009 11:24:42 +0000 (11:24 +0000)]
MFV of tzdata2009a
- Asia/Katmandu -> Asia/Kathmandu
- Fix historical references to DST in Switzerland
- Correct rules for America/Resolute (Nunavut)
- Cuba didn't have DST in 2005.
das [Thu, 22 Jan 2009 08:14:28 +0000 (08:14 +0000)]
Add support for multibyte thousands_sep encodings, e.g., U+066C.
The integer thousands' separator code is rewritten in order to
avoid having to preallocate a buffer for the largest possible
digit string with the most possible instances of the longest
possible multibyte thousands' separator. The new version inserts
thousands' separators for integers using the same code as floating point.
jeff [Thu, 22 Jan 2009 06:21:30 +0000 (06:21 +0000)]
- Update my copyright.
- Print human readable time as a float with two digits of precision. Use
ns now as well since clock periods are well into the hundreds of
picoseconds now.
- Show the average duration in the stats frame. This is often more useful
than total duration.
takawata [Thu, 22 Jan 2009 05:05:56 +0000 (05:05 +0000)]
Rename sc_is_pseudo to sc_nobulk member in ufoma_softc.
That was pseudo ucom because it used home brew tty interface.
Now, it is integrated to usb serial framework, so it is not pseudo
ucom any more.
jhb [Wed, 21 Jan 2009 23:10:06 +0000 (23:10 +0000)]
Add locking to ppc and ppbus and mark the whole lot MPSAFE:
- To avoid having a bunch of locks that end up always getting acquired as
a group, give each ppc(4) device a mutex which it shares with all the
child devices including ppbus(4), lpt(4), plip(4), etc. This mutex
is then used for all the locking.
- Rework the interrupt handling stuff yet again. Now ppbus drivers setup
their interrupt handler during attach and tear it down during detach
like most other drivers. ppbus(4) only invokes the interrupt handler
of the device that currently owns the bus (if any) when an interrupt
occurs, however. Also, interrupt handlers in general now accept their
softc pointers as their argument rather than the device_t. Another
feature of the ppbus interrupt handlers is that they are called with
the parent ppc device's lock already held. This minimizes the number
of lock operations during an interrupt.
- Mark plip(4), lpt(4), pcfclock(4), ppi(4), vpo(4) MPSAFE.
- lpbb(4) uses the ppc lock instead of Giant.
- Other plip(4) changes:
- Add a mutex to protect the global tables in plip(4) and free them on
module unload.
- Add a detach routine.
- Split out the init/stop code from the ioctl routine into separate
functions.
- Other lpt(4) changes:
- Use device_printf().
- Use a dedicated callout for the lptout timer.
- Allocate the I/O buffers at attach and detach rather than during
open and close as this simplifies the locking at the cost of
1024+32 bytes when the driver is attached.
- Other ppi(4) changes:
- Use an sx lock to serialize open and close.
- Remove unused HADBUS flag.
- Add a detach routine.
- Use a malloc'd buffer for each read and write to avoid races with
concurrent read/write.
- Other pps(4) changes:
- Use a callout rather than a callout handle with timeout().
- Conform to the new ppbus requirements (regular mutex, non-filter
interrupt handler). pps(4) is probably going to have to become a
standalone driver that doesn't use ppbus(4) to satisfy it's
requirements for low latency as a result.
- Use an sx lock to serialize open and close.
- Other vpo(4) changes:
- Use the parent ppc device's lock to create the CAM sim instead of
Giant.
- Other ppc(4) changes:
- Fix ppc_isa's detach method to detach instead of calling attach.
ed [Wed, 21 Jan 2009 19:43:10 +0000 (19:43 +0000)]
Add Unicode rendering to the teken demo application.
Some time ago I tried adding Unicode rendering to the teken demo
application, but I didn't get it working. It seems I forgot to call
setlocale(). Polish this code and make sure it doesn't get lost.
Also a small fix for my previous commit: all Unicode characters in
teken_boxdrawing are below 0x10000, so store them as 16-bit values.
imp [Wed, 21 Jan 2009 17:49:23 +0000 (17:49 +0000)]
Default to normal bus timing mode on SD cards. In practice, most
cards people have today support high speed mode, so the timing field
would be initialized to bus_timing_hs, but there are some slow
cards...
imp [Wed, 21 Jan 2009 17:39:11 +0000 (17:39 +0000)]
o The f_max is really at91_master_clock / 2, not 30MHz, so compute it as such.
o Only set 4-bit caps on those boards that have 4-bit caps (this means that
because we don't set wire4 yet, this forces us to always use 1-bit bus).
o Don't test wire4 when setting up the bus width, since bad things will
happen if we do.
# This likely won't fix the busted at91 sd card support, but these are
# needful changes for correctness.
imp [Wed, 21 Jan 2009 17:28:24 +0000 (17:28 +0000)]
Make the command reporting be under boot verbose.
Also, report a few other things under boot verbose.
Small style nit to make new code look like old code in this file.
kib [Wed, 21 Jan 2009 14:51:38 +0000 (14:51 +0000)]
Move the code from ufs_lookup.c used to do dotdot lookup, into
the helper function. It is supposed to be useful for any filesystem
that has to unlock dvp to walk to the ".." entry in lookup routine.
jhb [Wed, 21 Jan 2009 14:42:00 +0000 (14:42 +0000)]
Move the VA_MARKATIME flag for VOP_SETATTR() out into its own VOP:
VOP_MARKATIME() since unlike the rest of VOP_SETATTR(), VA_MARKATIME
can be performed while holding a shared vnode lock (the same functionality
is done internally by VOP_READ which can run with a shared vnode lock).
Add missing locking of the vnode interlock to the ufs implementation and
remove a special note and test from the NFS client about not supporting the
feature.
kientzle [Wed, 21 Jan 2009 06:55:27 +0000 (06:55 +0000)]
Merge-from-Googlecode r419
In archive_write_disk: If archive_write_header() fails to create
the file, that's a failure and should return ARCHIVE_FAILED.
Metadata restore failures still return ARCHIVE_WARN, because
that's non-critical. Fix test_write_disk_secure test to
verify the correct return code in one case; add test_write_disk_failures
to do another very simple test of restore failure.
This should fix cpio coredumping when it tries to restore to
a write-protected directory.
thompsa [Wed, 21 Jan 2009 04:19:18 +0000 (04:19 +0000)]
Add functions WITNESS so it can be asserted that the lock is not released for a
section of code, this uses WITNESS_NORELEASE() and WITNESS_RELEASEOK() to mark
the boundaries. Both functions require the lock to be held when calling.
This is intended for scenarios like a bus asserting that the bus lock is not
dropped during a driver call. There doesn't appear to be a man page to
document this in.
mav [Tue, 20 Jan 2009 22:26:09 +0000 (22:26 +0000)]
Check for infinite recursion possible on some broken PPTP/L2TP/... VPN setups.
Mark packets with mbuf_tag on first interface passage and drop on second.
kib [Tue, 20 Jan 2009 22:00:19 +0000 (22:00 +0000)]
The r187467 should remove all pages for V_NORMAL case too, because
indirect block pages are not removed by the mentioned invocation of
the vnode_pager_setsize().
Put a common code into the helper function ffs_pages_remove().
jkim [Tue, 20 Jan 2009 20:22:28 +0000 (20:22 +0000)]
- Add support for 8110SCe part. Some magic registers were taken from
Linux driver.
- Swap hardware revisions for 8110S and 8169S as Linux driver claims.
jkim [Tue, 20 Jan 2009 19:58:01 +0000 (19:58 +0000)]
- Do not read and write RX configuration register multiple times.
- Always program RX configuration register from scratch instead of
doing read/modify/write.
- Rename re_setmulti() to re_set_rxmode() to be reflect reality.
- Simplify hash filter logic a little while I am here.
luigi [Tue, 20 Jan 2009 18:16:31 +0000 (18:16 +0000)]
Fix a number of (innocuous) warnings, and remove a useless test.
There are still several signed/unsigned warnings left, which
require a bit more study for a proper fix.
This file has grown beyond reasonable limits.
We really need to split it into separate components (ipv4, ipv6,
dummynet, nat, table, userland-kernel communication ...) so we can
make mainteinance easier.
rdivacky [Tue, 20 Jan 2009 17:15:12 +0000 (17:15 +0000)]
Remove inlining of functions that are used mostly in different object files.
This gets rid of gnu89 style inlining. Also silence gcc by assigning two
variables NULL. This lets use to remove NO_WERROR.