John Baldwin [Thu, 29 Sep 2005 15:00:09 +0000 (15:00 +0000)]
Don't save and restore the ELCR register across suspend and resume for
the Intel 82371AB PCI-ISA bridge. We now do this all the time for the
!APIC case in the atpic driver. This cuts the raw line count for this
driver by about 40%.
Peter Edwards [Thu, 29 Sep 2005 14:09:46 +0000 (14:09 +0000)]
Remove checks for BOOTSIG[23] from FAT32 bootblocks.
There seems to be very little documentary evidence outside this
implementation to suggest a these checks are neccessary, and more
than one camera-formatted flash disk fails the check, but mounts
successfully on most other systems.
In em_process_receive_interrupts() store and clear adapter->fmt. This
make function reenterable. In the runtime the race is masked by serializing
of em_process_receive_interrupts() either by interrupt thread, or by
polling. The race can be triggered when polling is switched on or off.
Peter Edwards [Thu, 29 Sep 2005 10:37:20 +0000 (10:37 +0000)]
Close a race in biodone(), whereby the bio_done field of the passed
bio may have been freed and reassigned by the wakeup before being
tested after releasing the bdonelock.
There's a non-zero chance this is the cause of a few of the crashes
knocking around with biodone() sitting in the stack backtrace.
Joseph Koshy [Thu, 29 Sep 2005 01:40:03 +0000 (01:40 +0000)]
The 'intr_bufferfull' driver statistic actually counts the number
of times sampling was stopped due to a space shortage; change its
description in the output of `pmcstat -s` to match reality.
Implement suspend/resume methods to be more ACPI friendly.
I'm able to suspend/resume my laptop without this change, but then I need
to wait for the watchdog to reset the card.
With this change, it is ready immediately.
Nuke duplicates found via fuzzy logic:
- typos
- different spelling, punctuation, whitespace
- phonetically similar names
- words rearranged ("was once" vs "once was" etc)
If a limerick appeared as a single one and as part of a
double or triple, the singleton was removed.
With a little help from: sort limerick|uniq -d
This still turns up 20 lines being repeated, but the respective
limericks are sufficiently unique to leave them in (i.e. most differ
in at least two lines).
John Baldwin [Wed, 28 Sep 2005 18:04:11 +0000 (18:04 +0000)]
Add interrupt counters for IPIs. By default they are disabled, but they
can be enabled by enabling COUNT_IPIS in smptests.h. When enabled, each
CPU provides an interrupt counter for nearly all of the IPIs it receives
(IPI_STOP currently doesn't have a counter) that can be examined using
vmstat -i, etc.
Marius Strobl [Wed, 28 Sep 2005 15:01:58 +0000 (15:01 +0000)]
Fix an endianness issue in pnp_eisaformat(). This corrects printing PnP IDs
on big-endian archs like sparc64, e.g.:
uart0: <16550 or compatible> at port 0x3f8-0x3ff irq 43 pnpid @HEd041 on isa0
is now correctly printed as:
uart0: <16550 or compatible> at port 0x3f8-0x3ff irq 43 pnpid PNP0501 on isa0
There are probably other endianness issues lurking in the PnP code which
however aren't exhibited on sparc64 as the PnP devices there are sort of
PnP BIOS devices rather than ISA PnP devices.
Marius Strobl [Wed, 28 Sep 2005 14:54:07 +0000 (14:54 +0000)]
Add a font width argument to vi_load_font_t, vi_save_font_t and vi_putm_t
and do some preparations for handling 12x22 fonts (currently lots of code
implies and/or hardcodes a font width of 8 pixels). This will be required
on sparc64 which uses a default font size of 12x22 in order to add font
loading and saving support as well as to use a syscons(4)-supplied mouse
pointer image.
This API breakage is committed now so it can be MFC'ed in time for 6.0
and later on upcoming framebuffer drivers destined for use on sparc64
and which are expected to rely on using font loading internally and on
a syscons(4)-supplied mouse pointer image can be easily MFC'ed to
RELENG_6 rather than requiring a backport.
Tested on: i386, sparc64, make universe
MFC after: 1 week
Now that Giant is acquired in uprintf() and tprintf(), the caller no
longer leads to acquire Giant unless it also holds another mutex that
would generate a lock order reversal when calling into these functions.
Specifically not backed out is the acquisition of Giant in nfs_socket.c
and rpcclnt.c, where local mutexes are held and would otherwise violate
the lock order with Giant.
This aligns this code more with the eventual locking of ttys.
Push Giant down in jails. Pass the MPSAFE flag to NDINIT, and keep track
of whether or not Giant was picked up by the filesystem. Add VFS_LOCK_GIANT
macros around vrele as it's possible that this can call in the VOP_INACTIVE
filesystem specific code. Also while we are here, remove the Giant assertion.
from the sysctl handler, we do not actually require Giant here so we
shouldn't assert it. Doing so will just complicate things when Giant is removed
from the sysctl framework.
Peter Wemm [Tue, 27 Sep 2005 21:11:35 +0000 (21:11 +0000)]
I believe the stack underflows during early development that caused me to
add spare padding at the beginning of the pcb are long gone. Remove the
padding fields.
Robert Watson [Tue, 27 Sep 2005 21:02:59 +0000 (21:02 +0000)]
In lockstatus(), don't lock and unlock the interlock when testing the
sleep lock status while kdb_active, or we risk contending with the
mutex on another CPU, resulting in a panic when using "show
lockedvnods" while in DDB.
MFC after: 3 days
Reviewed by: jhb
Reported by: kris
Jung-uk Kim [Tue, 27 Sep 2005 20:57:50 +0000 (20:57 +0000)]
- Add a work-around for nForce3-250. Aperture base address encoded in misc.
control register and AGP bridge seems to be inconsistent with some BIOS.
Instead of relying on BIOS settings, we just take the initial aperture size
and encode them for both miscellaneous control register and AGP bridge.
Some idea was borrowed from agp_nvidia.c.
- Add preliminary ULi M1689 chipset support. The idea was taken from Linux
because hardware and documentation are unavailable. Not tested.
- Add more VIA chipset PCI IDs taken from Linux driver.
Approved by: anholt (mentor)
Tested by: Adam Gregoire <ebola at psychoholics dot org>
Ganael Laplanche <ganael.laplanche at martymac dot com>
K Wieland <kwieland at wustl dot edu>
Peter Wemm [Tue, 27 Sep 2005 18:32:46 +0000 (18:32 +0000)]
Fix a minor nit that has been bugging me for a while. Fix the obvious
cases of using a 64 bit operation to zero a register. 32 bit opcodes are
smaller and supposedly faster, and clear the upper 32 bits for free.
Peter Wemm [Tue, 27 Sep 2005 18:18:23 +0000 (18:18 +0000)]
Add a bare minimum (but wrong) R_X86_64_JMP_SLOT relocation type for
kernel modules. We actually need to include any addends and the symbol
offset value, but for gcc/binutils didn't set it anywhere I've found on
'cc -fpic -shared' kernel modules.
Peter Wemm [Tue, 27 Sep 2005 18:15:57 +0000 (18:15 +0000)]
Don't report Maxmem as 'real memory'. It is really the highest address
available and can give the wrong impression when there are memory holes.
Report the total amount of usable memory that we detected instead of the
highest address.
John Baldwin [Tue, 27 Sep 2005 18:07:05 +0000 (18:07 +0000)]
Use the reference count API to manage the reference counts for process
limit structures rather than using pool mutexes to protect the reference
counts.
Peter Wemm [Tue, 27 Sep 2005 18:04:20 +0000 (18:04 +0000)]
Implement 32 bit getcontext/setcontext/swapcontext on amd64. I've added
stubs for ia64 to keep it compiling. These are used by 32 bit apps such
as gdb.
John Baldwin [Tue, 27 Sep 2005 17:59:29 +0000 (17:59 +0000)]
- Document atomic_fetchadd(9) and add a MLINK.
- Add arm and ppc to the list of archs not supporting operations on 64-bit
integers.
- Update the sample code for acquiring a mutex to be more recent and to
take into account the recent atomic_foo_ptr() changes.
Roman Kurakin [Tue, 27 Sep 2005 16:57:44 +0000 (16:57 +0000)]
Restore if_cp.c 1.27
----------------------------
revision 1.27
date: 2005/09/19 03:10:16; author: imp; state: Exp; lines: +3 -2
Make sure that we call if_free(ifp) after bus_teardown_intr. Since we
could get an interrupt after we free the ifp, and the interrupt
handler depended on the ifp being still alive, this could, in theory,
cause a crash. Eliminate this possibility by moving the if_free to
after the bus_teardown_intr() call.
In fact, this change do nothing for this driver. It is protected from
this by cp_destroy variable. This variable also protects driver from initiation
of any activity from network stack with disabled intr handler with this change
applied.
Robert Watson [Tue, 27 Sep 2005 16:45:22 +0000 (16:45 +0000)]
Back out fifo_vnops.c:1.127, which introduced an sx lock around I/O on
a fifo. While this did indeed close the race, confirming suspicions
about the nature of the problem, it causes difficulties with blocking
I/O on fifos.
Discussed with: ups
Also spotted by: Peter Holm <peter at holm dot cc>
Roman Kurakin [Tue, 27 Sep 2005 16:12:49 +0000 (16:12 +0000)]
Backout if_cp 1.26, if_ct 1.27, if_cx 1.47 by obrien:
----------------------------
revision 1.26
date: 2005/09/07 09:53:35; author: obrien; state: Exp; lines: +1452 -1453
Reorder code to not depend on an ISO-C illegal forward extern declaration.
----------------------------
Reason: do not move large functions location without serious reason. The same
could be done by forward function declaration. Please do not enlarge diff
without a reason any more.
Backout if_cp 1.27
----------------------------
revision 1.27
date: 2005/09/19 03:10:16; author: imp; state: Exp; lines: +3 -2
Make sure that we call if_free(ifp) after bus_teardown_intr. Since we
could get an interrupt after we free the ifp, and the interrupt
handler depended on the ifp being still alive, this could, in theory,
cause a crash. Eliminate this possibility by moving the if_free to
after the bus_teardown_intr() call.
Reason: bad previous commit. Would be restored by next commit.
- Print space character in show_stat(). Remove a lot of priuntf(" ").
- Utilize show_stat() in sidewaysintpr() loop. This makes periodic
statistics to honor -h flag.
Andre Oppermann [Mon, 26 Sep 2005 20:25:16 +0000 (20:25 +0000)]
Implement IP_DONTFRAG IP socket option enabling the Don't Fragment
flag on IP packets. Currently this option is only repected on udp
and raw ip sockets. On tcp sockets the DF flag is controlled by the
path MTU discovery option.
Sending a packet larger than the MTU size of the egress interface
returns an EMSGSIZE error.
John Baldwin [Mon, 26 Sep 2005 18:42:27 +0000 (18:42 +0000)]
Small fixes to sis(4):
- Remove sis_unit and use device_printf() and if_printf() instead.
- Use callout_init_mtx() for the callout.
- Remove spls.
- Fix locking for ifmedia to happen in the ifmedia handlers rather than in
sis_ioctl().
- Log an error message if we fail to allocate any resources. Perform
cleanup if we fail to allocate any resources so that we don't leave
a mutex hanging around.
Tested by: Jason Tsai jason dot tsai at newcyberian dot com (1-4)
MFC after: 3 days
Warner Losh [Mon, 26 Sep 2005 18:27:13 +0000 (18:27 +0000)]
Emit a warning when a card matches multiple entries in our table. A
number of cards have been discovered to be matching on the strings of
the cis rather than manufacturer/product id for cards we already had a
prod id for. This is a result of getting the list from the NetBSD
driver which also includes the OID for the cards where such a
distinction mattered (since it was tested against the MAC address we
got from the card). Since we do not try to match OIDs, we do not need
the extra entries and they just waste space.
I'm guessing that some of the dlink entires (DE-660, DE-660+) and many
of the corega cards may fall into this boat and can safely be removed.
Warner Losh [Mon, 26 Sep 2005 18:22:24 +0000 (18:22 +0000)]
Go ahead and detach our children in our detach routine. I'm undecided
if we should delete them also or not, but have decided not to do so
for the moment.
Robert Watson [Mon, 26 Sep 2005 16:55:11 +0000 (16:55 +0000)]
Add "show allpcpu" to DDB, which prints the current CPU id followed by
the per-cpu data for all CPUs. This is easier to ask users to do than
"figure out how many CPUs you have, now run show pcpu, then run it
once for each CPU you have".