John Birrell [Sun, 18 Nov 2007 00:23:31 +0000 (00:23 +0000)]
Add a function to list symbols in a file and their values at the
same time rather than having to list the symbols and then go back
and look each one up by name.
Alan Cox [Sat, 17 Nov 2007 22:52:29 +0000 (22:52 +0000)]
Prevent the leakage of wired pages in the following circumstances:
First, a file is mmap(2)ed and then mlock(2)ed. Later, it is truncated.
Under "normal" circumstances, i.e., when the file is not mlock(2)ed, the
pages beyond the EOF are unmapped and freed. However, when the file is
mlock(2)ed, the pages beyond the EOF are unmapped but not freed because
they have a non-zero wire count. This can be a mistake. Specifically,
it is a mistake if the sole reason why the pages are wired is because of
wired, managed mappings. Previously, unmapping the pages destroys these
wired, managed mappings, but does not reduce the pages' wire count.
Consequently, when the file is unmapped, the pages are not unwired
because the wired mapping has been destroyed. Moreover, when the vm
object is finally destroyed, the pages are leaked because they are still
wired. The fix is to reduce the pages' wired count by the number of
wired, managed mappings destroyed. To do this, I introduce a new pmap
function pmap_page_wired_mappings() that returns the number of managed
mappings to the given physical page that are wired, and I use this
function in vm_object_page_remove().
Oleg Bulyzhin [Sat, 17 Nov 2007 21:54:57 +0000 (21:54 +0000)]
- New sysctl variable: net.inet.ip.dummynet.io_fast
If it is set to zero value (default) dummynet module will try to emulate
real link as close as possible (bandwidth & latency): packet will not leave
pipe faster than it should be on real link with given bandwidth.
(This is original behaviour of dummynet which was altered in previous commit)
If it is set to non-zero value only bandwidth is enforced: packet's latency
can be lower comparing to real link with given bandwidth.
Maxim Konovalov [Sat, 17 Nov 2007 17:05:01 +0000 (17:05 +0000)]
o Mask maximum file permissions we get from mount_ntfs -m
with ACCESSPERMS. Document in mount_ntfs(8) only the nine
low-order bits of mask are used (taken from mount_msdosfs(8)).
Bjoern A. Zeeb [Fri, 16 Nov 2007 22:35:33 +0000 (22:35 +0000)]
Move the priv check before the malloc call for so_pcb.
In case attach fails because of the priv check we leaked the
memory and left so_pcb as fodder for invariants.
John Baldwin [Fri, 16 Nov 2007 22:17:37 +0000 (22:17 +0000)]
Teach kgdb how to handle double fault frames on i386:
- Save td_oncpu in 'struct kthr' so the i386 target code can see which CPU
a thread is running on.
- Add a new frame unwinder for double fault frames. This unwinder is used
when "dblfault_handler" is encountered in the stack. It uses the CPU of
the current thread to lookup the base address of the TSS used for the
double fault from the GDT. It then fetches the various registers out
of the TSS similar to how the current trapframe unwinder fetches
registers out of the trapframe.
Jung-uk Kim [Fri, 16 Nov 2007 20:49:34 +0000 (20:49 +0000)]
Make VPD register access more robust:
- Implement timing out of VPD register access.[1]
- Fix an off-by-one error of freeing malloc'd space when checksum is invalid.
- Fix style(9) bugs, i.e., sizeof cannot be followed by space.
- Retire now obsolete 'hw.pci.enable_vpd' tunable.
Jung-uk Kim [Fri, 16 Nov 2007 16:39:27 +0000 (16:39 +0000)]
Do not report MAC, TX, and RX stats via sysctl(8) with BCM5705+.
The register layout is little different from memory-mapped stats
in the previous generation chips. In fact, it is bad because
registers in this range are cleared after reading them.
Colin Percival [Fri, 16 Nov 2007 13:57:41 +0000 (13:57 +0000)]
Fix "freebsd-update rollback" applied to minor-version upgrades: Old
shared object files which have the same name as currently-installed
shared object files should be reinstalled after binaries are rolled
back. The order for rolling back updates is therefore
1. Install any old shared object files which can be installed without
overwriting a new shared object file.
2. Rollback everything which isn't a shared object or kernel file.
3. Rollback any shared object files which we didn't deal with in (1).
4. Rollback to the old kernel.
Bug reported by: Jan Henrik Sylvester
MFC after: 3 days
Ken Smith [Fri, 16 Nov 2007 13:14:27 +0000 (13:14 +0000)]
The i386 disc1 size wandered above what fits on 650Mb media which has been
our target previously. So i386 joins the others that have switched over
to a separate livefs iso image.
Tai-hwa Liang [Fri, 16 Nov 2007 11:22:18 +0000 (11:22 +0000)]
MFP4(128855, 129015):
- Trying to eliminate another racing by replacing the timeout(9) with
callout APIs. In addition to that, the callout_drain() in an_detach()
help us to avoid a possible panic-on-free due to the callout API tries
to lock a destroyed mutex.
- In an_stats_update(), check the return value of an_read_record(). This
should reduce the chance of device removal(PCCARD) panic [2].
- Adding a comment to state the fact that an_stats_update() is now called
via callout(9) with a lock held [2].
Pyun YongHyeon [Fri, 16 Nov 2007 10:25:36 +0000 (10:25 +0000)]
IEEE 802.3 Annex 28B.3 explicitly specifies the following relative
priorities of the technologies supported by 802.3 Selector Field
value.
1000BASE-T full duplex
1000BASE-T
100BASE-T2 full duplex
100BASE-TX full duplex
100BASE-T2
100BASE-T4
100BASE-TX
10BASE-T full duplex
10BAST-T
However PHY drivers didn't honor the order such that 100BASE-T4 had
higher priority than 100BASE-TX full duplex. Fix that long standing
bugs such that have PHY drivers choose the highest common denominator
ability.
Fix a bug in dcphy which inadvertently aceepts 100BASE-T4.
Jack F Vogel [Thu, 15 Nov 2007 23:59:36 +0000 (23:59 +0000)]
Add PCI device support for Intel S7000FC4UR in usb and ichwd, systems
will not install without the usb changes in the install kernel, so I
would like to MFC this in time for 7.0 RC
Ruslan Ermilov [Thu, 15 Nov 2007 22:39:15 +0000 (22:39 +0000)]
Fix bad rule and bad dependency for nsparser.h that can
cause the build to fail because y.tab.c can have a more
recent modification time than y.tab.h, and the bad rule
relied on the opposite.
(The last write to y.tab.c by yacc(1) happens after the
last write to y.tab.h, according to truss(1).)
John Baldwin [Thu, 15 Nov 2007 22:00:57 +0000 (22:00 +0000)]
Add support for cross double fault frames in stack traces:
- Populate the register values for the trapframe put on the stack by the
double fault handler.
- Teach DDB's trace routine to treat a double fault like other trap frames.
Randall Stewart [Thu, 15 Nov 2007 14:20:07 +0000 (14:20 +0000)]
- Adds event handlers for process_ctor,process_dtor, process_init,
process_fini, thread_ctor, thread_dtor, thread_init, thread_fini. This
will allow us to extend dynamically areas in proc/thread for dtrace ;-)
Reviewed by: rwatson
Randall Stewart [Thu, 15 Nov 2007 13:28:54 +0000 (13:28 +0000)]
Adds an event handler for:
- process_ctor,dtor, init and fini
- thread_ctor,dtor, init and fini
This allows the ability to add on additional things
during construction/destruction of threads and processes.
Julian Elischer [Thu, 15 Nov 2007 02:13:44 +0000 (02:13 +0000)]
When forking, the new thread deserves a name too. Don't just use the
td_startcopy section as it is not the right thing to do
in other cases (e.g. if starting a new thread from one that is already named).
David E. O'Brien [Wed, 14 Nov 2007 22:58:36 +0000 (22:58 +0000)]
Bring in FSF revision 1.9 (Change type of ps_strings from int to u_long).
This fixes a situation where GDB gives incorrect backtraces when a signal
handler is in the call chain.
Marcel Moolenaar [Wed, 14 Nov 2007 20:21:54 +0000 (20:21 +0000)]
o Rename cpu_thread_setup() to cpu_thread_alloc() to better
communicate that it relates to (is called by) thread_alloc()
o Add cpu_thread_free() which is called from thread_free()
to counter-act cpu_thread_alloc().
i386: Have cpu_thread_free() call cpu_thread_clean() to
preserve behaviour.
ia64: Have cpu_thread_free() call mtx_destroy() for the
mutex initialized in cpu_thread_alloc().
Gleb Smirnoff [Wed, 14 Nov 2007 11:25:58 +0000 (11:25 +0000)]
- Merge all the ng_send_fn2* functions into one - ng_send_fn2(),
removing some copy&pasted code.
- Reduce copy and paste in ng_apply_item().
- Resurrect ng_send_fn() as a valid symbol, not a define.
Luigi Rizzo [Wed, 14 Nov 2007 07:38:22 +0000 (07:38 +0000)]
Fix build of the "package" target, ignoring non existing
floppy types (in fact, we have only one left!)
Also cleanup some code, using || and && in some places, and
using "export VAR=value" instead of two separate lines.
Julian Elischer [Wed, 14 Nov 2007 06:21:24 +0000 (06:21 +0000)]
generally we are interested in what thread did something as
opposed to what process. Since threads by default have teh name of the
process unless over-written with more useful information, just print the
thread name instead.
Julian Elischer [Wed, 14 Nov 2007 05:43:55 +0000 (05:43 +0000)]
Apply the same sort of locking done in
sys/dev/acpica/acpi.c rev 1.196 a while ago:
Grab Giant around calls to DEVICE_SUSPEND/RESUME in
acpi_SetSleepState().
If we are resuming non-MPSAFE drivers, they need Giant held for them.
This may fix some obscure suspend/resume problems. It has fixed keyrate
setting problems that were triggered by cardbus (MPSAFE) changing the
ordering for syscons resume (non-MPSAFE). Also, add some asserts that
Giant is held in our suspend/resume and shutdown methods.
Luigi Rizzo [Wed, 14 Nov 2007 05:42:54 +0000 (05:42 +0000)]
Fix picobsd builds. Changes include:
- use proper make configuration for the build, using
${BINMAKE} as evaluated by ${VERSION}/src/Makefile
- remove -lmytinfo from crunch.conf
- remove support for login_access in tinyware/login
- remove "machine i386" from the kernel config file
It might actually be interesting to extend the script to do
a cross build for !i386 ...
Peter Wemm [Tue, 13 Nov 2007 23:00:24 +0000 (23:00 +0000)]
Drastically simplify the i386 pcpu backend by merging parts of the
amd64 mechanism over. Instead of page table hackery that isn't
actually needed, just use 'struct pcpu __pcpu[MAXCPU]' for backing like
all the other platforms do. Get rid of 'struct privatespace' and a
while mess of #ifdef SMP garbage that set it up. As a bonus, this
returns the 4MB of KVA that we stole to implement it the old way.
This also allows you to read the pcpu data for each cpu when reading a
minidump.
Background information: Originally, pcpu stuff was implemented as having
per-cpu page tables and magic to make different data structures appear
at the same actual address. In order to share page tables, we switched
to using the GDT and %fs/%gs to access it. But we still did the evil
magic to set it up for the old way. The "idle stacks" are not used
for the idle process anymore and are just used for a few functions during
bootup, then ignored. (excercise for reader: free these afterwards).
Rink Springer [Tue, 13 Nov 2007 16:12:59 +0000 (16:12 +0000)]
Remove the IEEE80211_C_WEP capability flag - setting it makes net80211 expect
that the driver will handle WEP encryption. However, this does not seem to be
implemented by this driver (or maybe the chipset doesn't support it?)
Removing the flag makes my wpi card work using wpa_supplicant(8) on a
network with 802.1x security (without this change it authenticated fine, but
tcpdump only saw garbage packets)
Reviewed by: benjsc, imp (mentor)
Approved by: imp (mentor), sam
Peter Grehan [Tue, 13 Nov 2007 15:47:55 +0000 (15:47 +0000)]
Split decr_init() into two, with the section that reads the timebase
frequency from OpenFirmware moved out and into a routine that is called
from cpu_startup().
This allows correct reporting of the CPU clockspeed when printing out
CPU information at boot time.
Reported by: numerous
Reviewed by: marcel
MFC after: 1 day
Bjoern A. Zeeb [Mon, 12 Nov 2007 23:53:43 +0000 (23:53 +0000)]
Though we are currently not interested in the EDD3 flag,
Enhanced Disk Drive Specification Ver 3.0 defines that the version
of extension in AH would be 30h.
Correct the check for that to be >=30h instead of >3h.
MFC after: 2 months
John Baldwin [Mon, 12 Nov 2007 21:51:38 +0000 (21:51 +0000)]
Move the agp(4) driver from sys/pci to sys/dev/agp. __FreeBSD_version was
bumped to 800004 to note the change though userland apps should not be
affected since they use <sys/agpio.h> rather than the headers in
sys/dev/agp.
John Baldwin [Mon, 12 Nov 2007 20:02:21 +0000 (20:02 +0000)]
write(1) needs to strip off the leading /dev/ from the tty name for the
current tty as returned from ttyname(3) so it can try to avoid writing to
the current tty if possible. Previously, it did this by trimming off any
leading directory (effectively performing a basename(3) on the path
returned from ttyname(3)). However, this chopped off too much of the path
for ttys who have directories in their name such as pts(4). Instead, just
strip off the leading /dev/ from the path returned by ttyname(3). This
fixes write(1) when using pts(4).
Xin LI [Mon, 12 Nov 2007 18:57:33 +0000 (18:57 +0000)]
Correct a stack overflow which will trigger panics when
mode= is specified, caused by incorrect format string
specified to vfs_scanopt() and subsequently vsscanf().
Jeff Roberson [Mon, 12 Nov 2007 17:33:07 +0000 (17:33 +0000)]
- Fix the ktr header regexp so we match lines with very large indexes.
- Add support for messages where cpu load is added to a remote cpu.
- print unmatched lines to stdout
Colin Percival [Mon, 12 Nov 2007 04:47:57 +0000 (04:47 +0000)]
Add support for "freebsd-update -r newrelease upgrade" -- binary
upgrading to new releases. Important parts of this code include
* automatically determining which optional components (e.g., src,
info, proflibs) are installed.
* merging changes in files which are modified locally and have
changed between the currently running and new release.
* prompting the user to rebuild all 3rd party software before
deleting old shared libraries.
Yes, this is compatible with "freebsd-update rollback" -- you can
test a new -BETA and roll back to the old release if you don't
like it.
Subject to re@ approval, this will be MFCed before 7.0-BETA3 and
6.3-RC1.