Jung-uk Kim [Tue, 23 Mar 2010 22:50:22 +0000 (22:50 +0000)]
Fall back to VGA palette functions if VESA function failed and DAC is still
in 6-bit mode. Although we have to check non-VGA compatibility bit here,
it seems there are too many broken VESA BIOSes out to rely on it.
Jung-uk Kim [Tue, 23 Mar 2010 22:35:52 +0000 (22:35 +0000)]
Map entire video memory again. This is a partial backout of r203535.
Although we do not use them all directly, it seems VGA render may access
unmapped memory region and cause kernel panic.
Marcel Moolenaar [Tue, 23 Mar 2010 20:12:53 +0000 (20:12 +0000)]
Add definitions for a 4th PCI host controller. No Freescale processor
has all 4 implemented, but across the processors we now support all the
combinations. For example, the MPC8533 doesn't have a PCI controller
at 0xA0000, but does at 0xB0000.
Marcel Moolenaar [Tue, 23 Mar 2010 19:30:56 +0000 (19:30 +0000)]
Enable power management for E500 cores. Use "doze" for now to make
sure the caches remain coherent. For single-core configurations and
with busdma changes we could eventually switch to "nap" and force
a D-cache invalidation as part of the DMA completion. To this end,
clear PSL_WE until after we handled the decrementer or external
interrupt as it tells us whether we just woke up or not.
Rui Paulo [Tue, 23 Mar 2010 14:31:31 +0000 (14:31 +0000)]
When receiving a management frame, pass the mbuf to bpf before calling
iv_recv_mgmt(). iv_recv_mgmt() will generate management frame responses
and pass them to bpf before the management frame that triggered the
response.
PR: 144323
Submitted by: Alexander Egorenkov <egorenar at gmail.com>
MFC after: 2 weeks
Sponsored by: iXsystems, inc.
Nathan Whitehorn [Tue, 23 Mar 2010 03:14:44 +0000 (03:14 +0000)]
Get nexus(4) out of the RTC business. The interface used by nexus(4)
in Open Firmware was Apple-specific, and we have complete coverage of Apple
system controllers, so move RTC responsibilities into the system controller
drivers. This avoids interesting problems from manipulating these devices
through Open Firmware behind the backs of their drivers.
Randall Stewart [Tue, 23 Mar 2010 01:36:50 +0000 (01:36 +0000)]
Fixes a bug where SACKs in the face of
mapping_array expansion would break. Basically
once we expanded the array we no longer had both
mapping arrays in sync which the sack processing code depends on.
This would mean we were randomly referring to memory that was probably
not there. This mostly just gave us bad sack results going back to the peer.
If INVARIENTS was on of course we would hit the panic routine in the sack_check
call.
We also add a print routine for the place where one would panic in
invarients so one can see what the main mapping array holds.
Nathan Whitehorn [Tue, 23 Mar 2010 01:09:45 +0000 (01:09 +0000)]
Do not declare the various OFW command buffers static. It does not
appear to be necessary on either sparc64 or powerpc, and is a
concurrency nightmare.
Kip Macy [Mon, 22 Mar 2010 23:04:12 +0000 (23:04 +0000)]
- boot-time size the ipv4 flowtable and the maximum number of flows
- increase flow cleaning frequency and decrease flow caching time
when near the flow limit
- stop allocating new flows when within 3% of maxflows don't start
allocating again until below 12.5%
Edwin Groothuis [Mon, 22 Mar 2010 21:27:51 +0000 (21:27 +0000)]
MFV of tzdata2010f:
The Australian Antartic Division:
- Macquarie Island will stay on UTC+11 for winter and not switch back from DST.
- Casey station reverted to its normal time of UTC+8 on 5 March 2010.
- Davis station will revert to its normal time of UTC+7 at 10 March 2010
- Mawson station stays on UTC+5.
Syria will start DST on Thursday 1 April 2010 at midnight.
Edwin Groothuis [Mon, 22 Mar 2010 21:25:08 +0000 (21:25 +0000)]
Vendor import of tzdata2010f:
The Australian Antartic Division:
- Macquarie Island will stay on UTC+11 for winter and not switch back from DST.
- Casey station reverted to its normal time of UTC+8 on 5 March 2010.
- Davis station will revert to its normal time of UTC+7 at 10 March 2010
- Mawson station stays on UTC+5.
Syria will start DST on Thursday 1 April 2010 at midnight.
Marcel Moolenaar [Mon, 22 Mar 2010 18:24:42 +0000 (18:24 +0000)]
o Remove the pmap argument to pmap_invalidate_all() as it's not used
other than in a potentially dangerous KASSERT.
o Hand-inline pmap_remove_page() as it's only called from 1 place and
the abstraction that pmap_remove_page() provides is not enough to
warrant the obfuscation. Eliminate the dangerous KASSERT in the
process.
o In pmap_remove_pte(), remove the KASSERT for pmap being the current
one as it's not safe in the face of CPU migration.
pam_end() already contains a NULL check, and it is not unreasonable to
call it with a NULL pamh in a cleanup / error-handling situation. Remove
OPENPAM_NONNULL, which may cause gcc to optimize away the NULL check.
This fixes a potential NULL pointer dereference in error-handling code
in passwd(1).
pam_end() already contains a NULL check, and it is not unreasonable to
call it with a NULL pamh in a cleanup / error-handling situation. Remove
OPENPAM_NONNULL, which may cause gcc to optimize away the NULL check.
Marcel Moolenaar [Mon, 22 Mar 2010 04:24:19 +0000 (04:24 +0000)]
Drop the pmap argument to pmap_invalidate_page(). It's not used other
than in a KASSERT. The KASSERT is broken in that it's done outside the
critical section and as such isn't protected against CPU migration.
Improve pmap_invalidate_page() as follows:
o calculate vhpt_ofs inside the critical region for exactly the same
reason.
o calculate the tag outside the FOREACH loop, as it's loop-invariant.
This is more efficient.
o Replace the test and set with an atomic cmpset operation because we
are changing other CPU's VHPT tables and this avoids invalidating
after the entry got modified. Not necessarily a problem, but better
safe than sorry.
Marcel Moolenaar [Mon, 22 Mar 2010 04:01:45 +0000 (04:01 +0000)]
With preemption, the high FP registers may get enabled by cpu_switch()
before we grab the mutex. Don't assert that they must be disabled at
that point. We pretty much bypass all logic in that case anyway and
leave immediately, so there's no harm.
Marcel Moolenaar [Mon, 22 Mar 2010 03:55:18 +0000 (03:55 +0000)]
Fix interrupt handling by extending the critical region so that
preemption doesn't happen until after all pending interrupt have
been services.
While here again, simplify the EOI handling by doing it after we
call the XIV-specific handlers, rather than in each of them. The
original thought was that we may want to do an EOI first and the
actual IPI handling next, but that's mostly a micro-optimization.
Marcel Moolenaar [Mon, 22 Mar 2010 03:06:11 +0000 (03:06 +0000)]
Disable interrupts when calling into SAL for PCI configuration
cycles. This serves 2 purposes:
1. It prevents preemption and CPU migration while running SAL code.
2. It reduces the chance of stack overflows: we're supposed to enter
SAL with at least 16KB of either memory- or register stack space,
which we can't do without switching to a different stack.
Marcel Moolenaar [Mon, 22 Mar 2010 02:01:33 +0000 (02:01 +0000)]
Define curthread as an inline function that loads the thread pointer
directly from r13, the pcpu pointer. This guarantees correct behaviour
when the thread migrates to a different CPU.
Marcel Moolenaar [Sun, 21 Mar 2010 22:33:09 +0000 (22:33 +0000)]
Don't include <machine/_regset.h> when _MACHINE_REGSET_H_ in defined.
This is not for multiple inclusion purposes, because _regset.h already
handles this, but to enable inclusion of the MD header by cross-tools
on non-ia64 installations. The cross-tool can include _regset.h itself
before including MD headers that depend on it.
Olivier Houchard [Sun, 21 Mar 2010 21:03:35 +0000 (21:03 +0000)]
Make sure we insert and remove the PV entries related to unmanaged kernel
mappings into the kernel pmap, not into the pmap related to the
pmap_enter_pv()/pmap_remove_pv() call.
Ed Schouten [Sun, 21 Mar 2010 20:43:23 +0000 (20:43 +0000)]
Actually make O_DIRECTORY work.
According to POSIX open() must return ENOTDIR when the path name does
not refer to a path name. Change vn_open() to respect this flag. This
also simplifies the Linuxolator a bit.
Marius Strobl [Sun, 21 Mar 2010 13:09:54 +0000 (13:09 +0000)]
- The firmware of Sun Fire V1280 has a misfeature of setting %wstate to
7 which corresponds to WSTATE_KMIX in OpenSolaris whenever calling into
it which totally screws us even when restoring %wstate afterwards as
spill/fill traps can happen while in OFW. The rather hackish OpenBSD
approach of just setting the equivalent of WSTATE_KERNEL to 7 also is
no option as we treat %wstate as a bit field. So in order to deal with
this problem actually implement spill/fill handlers for %wstate 7 which
just act as the WSTATE_KERNEL ones except of theoretically also handling
32-bit, turn off interrupts completely so we don't even take IPIs while
in OFW which should ensure we only take spill/fill traps at most and
restore %wstate after calling into OFW once we have taken over the trap
table. While at it, actually set WSTATE_{,PROM}_KMIX before calling into
OFW just like OpenSolaris does, which should at least help testing this
change on non-V1280.
- Remove comments referring to the %wstate usage in BSD/OS.
- Remove the no longer used RSF_ALIGN_RETRY macro.
- Correct some trap table addresses in comments.
- Ensure %wstate is set to WSTATE_KERNEL when taking over the trap table.
- Ensure PSTATE_AM is off when entering or exiting to OFW as well as that
interrupts are also completely off when exiting to OFW as the firmware
trap table shouldn't be used to handle our interrupts.
Alan Cox [Sun, 21 Mar 2010 00:13:11 +0000 (00:13 +0000)]
I am told by AMD that the machine check hardware on the instruction TLB
won't generate bogus exceptions. Therefore, the implementation of the
"unofficial" workaround needn't mask L1TP errors by the instruction cache
unit.
Marius Strobl [Sat, 20 Mar 2010 23:00:43 +0000 (23:00 +0000)]
Improve the KVA space sizing of 186682; on machines with large dTLBs we
can actually use all of the available lockable entries of the tiny dTLB
for the kernel TSB. With this change the KVA space sizing happens to be
more in line with the MI one so up to at least 24GB machines KVA doesn't
need to be limited manually. This is just another stopgap though, the
real solution is to take advantage of ASI_ATOMIC_QUAD_LDD_PHYS on CPUs
providing it so we don't need to lock the kernel TSB pages into the dTLB
in the first place.
Marius Strobl [Sat, 20 Mar 2010 22:32:13 +0000 (22:32 +0000)]
- While SPARC V9 allows tininess to be detected either before or after
rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and
UltraSPARC processors defines that in all cases tinyness is detected
before rounding, therefore rounding up to the smallest normalised
number should set the underflow flag.
- If an infinite result is rounded down, the result should have an
exponent 1 less than the value for infinity.
PR: 144900
Submitted by: Peter Jeremy
MFC after: 3 days
Kip Macy [Sat, 20 Mar 2010 19:47:30 +0000 (19:47 +0000)]
- spread tcp timer callout load evenly across cpus if net.inet.tcp.per_cpu_timers is set to 1
- don't default to acquiring tcbinfo lock exclusively in rexmt
Jaakko Heinonen [Sat, 20 Mar 2010 16:16:13 +0000 (16:16 +0000)]
Escape characters unsafe for XML output in GEOM class, instance and
provider names.
- Characters in range 0x01-0x1f except '\t', '\n', and '\r' are replaced
with '?'. Those characters are disallowed in XML.
- '&', '<', '>', '\'', '"' and characters in range 0x7f-0xff are
replaced with XML numeric character reference.
If the kern.geom.confxml sysctl provides invalid XML, libgeom
geom_xml2tree() fails and utilities using it do not work. Unsafe
characters are common in msdosfs and cd9660 labels.
Nathan Whitehorn [Sat, 20 Mar 2010 14:35:24 +0000 (14:35 +0000)]
Revisit locking in the 64-bit AIM PMAP. The PVO head for a page is
generally protected by the VM page queue mutex. Instead of extending the
table lock to cover the PVO heads, add some asserts that the page queue
mutex is in fact held. This fixes several LORs and possible deadlocks.
This also adds an optimization to moea64_kextract() useful for
direct-mapped quantities, like UMA buffers. Being able to use this from
inside UMA removes an additional LOR.
Gavin Atkinson [Sat, 20 Mar 2010 12:39:28 +0000 (12:39 +0000)]
Remove some stale entries from MAINTAINERS:
- aradford@amcc.com bounces.
- gad said to drop pkill(1) and ps(1).
- jmallett said to drop libufs.
- joerg said to drop fdc(4) and sppp(4)
Warner Losh [Sat, 20 Mar 2010 03:39:35 +0000 (03:39 +0000)]
Add support for the Samsung S3C2xx0 family of ARM SoCs written by
Andrew Turner. The kernel supports the LN2410SBC evaluation board,
and likely others. These parts (or similar ones) are in some open
hardware designs for phones.
Jung-uk Kim [Fri, 19 Mar 2010 21:15:43 +0000 (21:15 +0000)]
- Map EBDA if available and add 64KB above 1MB (high memory), just in case.
- Print the initial memory map when bootverbose is set.
- Change the page fault address format from linear to %cs:%ip style.
- Move duplicate code into a newly added function.
- Add strictly aligned memory access for distant future. ;-)
The same code is used to import and to create pool.
The order of operations is the following:
1. Try to open vdev by remembered path and guid.
2. If 1 failed, try to find vdev which guid matches and ignore the path.
3. If 2 failed this means either that the vdev we're looking for is gone
or that pool is being created and vdev doesn't contain proper guid yet.
To be able to handle pool creation we open vdev by path anyway.
Because of 3 it is possible that we open wrong vdev on import which can lead to
confusions.
The solution for this is to check spa_load_state. On pool creation it will be
equal to SPA_LOAD_NONE and we can open vdev only by path immediately and if it
is not equal to SPA_LOAD_NONE we first open by path+guid and when that fails,
we open by guid. We no longer open wrong vdev on import.
Bjoern A. Zeeb [Fri, 19 Mar 2010 19:51:03 +0000 (19:51 +0000)]
Split eventhandler_register() into an internal part and a wrapper function
that provides the allocated and setup eventhandler entry.
Add a new wrapper for VIMAGE that allocates extra space to hold the
callback function and argument in addition to an extra wrapper function.
While the wrapper function goes as normal callback function the
argument points to the extra space allocated holding the original func
and arg that the wrapper function can then call.
Provide an iterator function for the virtual network stack (vnet) that
will call the callback function for each network stack.
Provide a new set of macros for VNET that in the non-VIMAGE case will
just call eventhandler_register() while in the VIMAGE case it will use
vimage_eventhandler_register() passing in the extra iterator function
but will only register once rather than per-vnet.
We need a special macro in case we are interested in the tag returned
as we must check for curvnet and can neither simply assign the
return value, nor not change it in the non-vnet0 case without that.
Ed Schouten [Fri, 19 Mar 2010 15:53:02 +0000 (15:53 +0000)]
Slightly improve my previous commit.
Just comment out the atrun line instead of completely removing it. It is
not a bad idea to leave it as a reference in case someone decides to
install atrun by hand afterwards.
John Baldwin [Fri, 19 Mar 2010 12:43:18 +0000 (12:43 +0000)]
Use the same policy for rejecting / not-reject ACPI tables with incorrect
checksums as the base acpi(4) driver. This fixes a problem where the MADT
parser would reject the MADT table during early boot causing the MP Table
to be, but then the acpi(4) driver would attach and use non-SMP interrupt
routing.
Tested by: Alastair Hogge agh of coolrhaug com
MFC after: 1 week
Move SysV IPC freebsd32 compat shims from freebsd32_misc.c to corresponding
sysv_{msg,sem,shm}.c files.
Mark SysV IPC freebsd32 syscalls as NOSTD and add required
SYSCALL_INIT_HELPER/SYSCALL32_INIT_HELPERs to provide auto
register/unregister on module load.
This makes COMPAT_FREEBSD32 functional with SysV IPC compiled and loaded
as modules.