Commit Graph

1325 Commits

Author SHA1 Message Date
bsh
ae462c19db fix typo pointed out by Olivier Houchard. thanks. 2003-11-26 12:17:18 +00:00
rearnsha
445d91a12e Reposition a couple of NOP instructions for better efficiency. 2003-11-26 10:31:53 +00:00
christos
a21fdf3b43 bye, bye _MCONTEXT_TO_SIGCONTEXT and vice versa. 2003-11-25 23:11:52 +00:00
scw
d657bddd8c In data_abort_handler(), honour pcb_onfault even in the case where
current_intr_depth > 0.
2003-11-20 14:44:36 +00:00
scw
61aab8b582 On a fatal fault, dump the trapframe's contents to the console.
This is useful when DDB is not available, or practical.
2003-11-18 22:39:05 +00:00
scw
5801c73162 - Remove ixpsip_bs_tag (ixp425_sip_io.c). It just duplicated some of
the functionality of ixp425_bs_tag.
 - Add missing stream_{read,write}_1 ops to ixp425_bs_tag.
 - Re-work the delay() implementation to use the free-running Time-
   Stamp counter. This removes the need to bootstrap TMR0 early on.
2003-11-16 12:41:03 +00:00
scw
07acf64710 Re-instate the behaviour of sending SIGKILL to a process if uvm_fault()
returns ENOMEM. SIGSEGV just doesn't cut it. The original code looks to
have been lost in revision 1.34.
2003-11-15 20:18:34 +00:00
scw
a7533e4cdc - Add LOCKDEBUG-protected calls to sched_lock_idle() to cpu_switchto and
the idle loop. They seem to have gone AWOL sometime in the past.
   Fixes port-arm/23390.
 - While here, tidy up the idle loop.
 - Add a cheap DIAGNOSTIC check for run queue sanity.
2003-11-15 08:44:18 +00:00
briggs
dfa839f16b Make sure that L_SA_PAGEFAULT gets cleared from l_flag if pmap_fault_fixup
returns non-zero and we want to shortcut out.  This avoids a bogus pagefault
condition being detected in sa_switch().
Many thanks to Christian Limpach for finding this, obviating my band-aid
patch to kern_sa.c (posted on tech-kern).
2003-11-14 21:22:08 +00:00
scw
4eeb1be7e4 Check alignment of the fault PC before de-referencing it.
Give the process a Illegal Instruction fault if the PC is misaligned.
2003-11-14 19:03:17 +00:00
scw
a590a31135 - In data_abort_handler(), move the fault pc alignment check to before
the call to data_abort_fixup() as the fixup routines also try to
   de-reference the fault pc.

 - If a fault came from kernel mode, and the fault address looks to be in
   the kernel's address space, and pcb_onfault is *set*, check the
   instruction which caused the fault. If it's LDR{B,}T or STR{B,}T
   then one of the copy in/out routines is trying to read/write a
   kernel address with the wrong privilege. If that address is actually
   mapped, we could end up in an infinite loop because we failed to
   notice that it's really a 'user mode' access. Yay for "crashme".
   I suspect this also fixes PR port-arm/23052.

   Note: This *could* be fixed by adding sanity checks to copyin et al,
   but that would add extra overhead to the non-error path...

 - Fix a couple of __predict_false cases.
2003-11-14 19:00:03 +00:00
scw
571f89c4ad Slight re-org of the alignment/ast exit macro to better mimic the
original behaviour WRT cpsr/I32_bit handling.
2003-11-14 16:57:28 +00:00
scw
bb0221494d Since data_abort_handler() may have to decode the instruction at tf->tf_pc
to determine if a fault is read or write, make sure tf->tf_pc is 32-bit
aligned before dereferencing it.

Otherwise, deliver an illegal instruction signal to the process. We don't
support execution of Thumb code at this time.
2003-11-14 00:21:30 +00:00
chs
e07f0b9362 eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed.  however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors.  most of
the callers of uvm_useracc() make the above incorrect assumption.  the
rest are all misguided optimizations, which optimize for the case
where an operation will fail.  we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors.  since there appear to be no good uses of uvm_useracc(), we'll
just remove it.
2003-11-13 03:09:28 +00:00
scw
f99d0398fb The previous commit had a #endif in the wrong place. 2003-11-11 08:27:16 +00:00
wiz
ee1b406595 Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
2003-11-10 08:51:51 +00:00
scw
41d2057ea7 Pick the right value for {,_}MACHINE_ARCH according to endianness.
Spotted by mrg@.
2003-11-09 08:27:19 +00:00
tsutsui
112c91d583 Use #if defined(_KERNEL_OPT) to protect #include "opt_xxx.h"
from building LKM etc. Suggested by mrg.
2003-11-09 05:29:59 +00:00
he
c45fa09365 Suppress apparently-bogus -Wunitialized warnings, the compiler does
not detect that set / use occur under equal conditions in following
if() statements.
2003-11-07 18:29:30 +00:00
scw
f77bf2bb0c Enable/Restore alignment fault state on interrupt handler entry/exit. 2003-11-05 21:10:59 +00:00
scw
aee833c0ee Add "options ARM32_DISABLE_ALIGNMENT_FAULTS" to forcibly disable
alignment fault checking if necessary.

This option gets the acorn32 port working again.

XXX: Richard Earnshaw suggested enabling alignment faults for
XXX: userland only on acorn32. Need to investigate this.
2003-11-05 12:53:15 +00:00
scw
5d63abe1f1 Fix a braino introduced in r1.37. Thanks to Tom Spindler for spotting it. 2003-11-04 22:20:50 +00:00
dsl
2ffbd2ab99 Remove p_nras from struct proc - use LIST_EMPTY(&p->p_raslist) instead.
Remove p_raslock and rename p_lwplock p_lock (one lock is enough).
Simplify window test when adding a ras and correct test on VM_MAXUSER_ADDRESS.
Avoid unpredictable branch in i386 locore.S
(pad fields left in struct proc to avoid kernel bump)
2003-11-04 10:33:15 +00:00
scw
e9cd075343 It makes more sense to map the expansion bus registers in ixpsip
instead of the pci bridge driver.
2003-11-02 21:24:39 +00:00
scw
21f388f6e0 Add generic read/write region 1 ops. 2003-11-02 21:20:32 +00:00
reinoud
4e923603f1 Fix for PR # 23264 thanks to Mike Pumford; it is only attatching clock once
now.
2003-11-01 23:37:54 +00:00
jdolecek
3abecdb88d avoid stong words in comments 2003-11-01 17:35:42 +00:00
scw
b4c2d3dbb0 Insert some nops around the load instructions in badaddr_read_N().
That way, we can be sure any imprecise data abort actually happens
before clearing pcb_onfault.
2003-10-31 16:54:05 +00:00
cl
ef56cc40ab Reduce code duplication by adding mi_userret() in sys/userret.h
containing signal posting, kernel-exit handling and sa_upcall processing.

XXX the pc532, sparc, sparc64 and vax ports should have their
XXX userret() code rearranged to use this.
2003-10-31 16:44:34 +00:00
scw
336806eb55 Overhaul arm32's abort handlers:
- Assume a permission fault is always the result of an attempted
   write, so no need to disassemble the opcode.
   (as discussed with Richard Earnshaw/Jason Thorpe a week or two ago)

 - Split out non-MMU data aborts into separate functions, and deal
   correctly with XScale imprecise aborts. Specifically, the old code
   made no attempt to handle the double abort faults which can occur
   as a result of two consecutive external (imprecise) aborts. This
   was easy to provoke by read(2)ing from a /dev/mem offset which caused
   an external abort. With the old code, this would bring the system
   down instantly, with little clue as to why. (hint: tf_spsr held
   PSR_ABT32_MODE...)

 - Re-write badaddr_read() to use pcb_onfault instead of adding extra
   overhead to data_abort_handler(). A side effect of this is that it
   now benefits from the XScale double abort recovery.

 - Invoke the cpu-specific prefetch/data abort fixup routines only if
   the host cpu actually needs it. On other cpus, the code is optimised
   away.

 - Sprinkle __predict_{false,true} in all the right places.

 - G/C some excess debugging baggage.
2003-10-31 16:30:15 +00:00
simonb
6d85c5e0d5 Don't pass the (unused) return value args to the
trace_enter()/systrace_enter() functions.
2003-10-31 03:28:12 +00:00
thorpej
920b229e72 "bogus pin" -> "bogus device" in last change. 2003-10-31 01:12:06 +00:00
matt
b9e31106e8 Stop some (bogus) gcc unitialized variable warning. 2003-10-30 22:04:39 +00:00
matt
a72426fa60 Fix (real) uninitialized error. (Someone familiar with this should see
if is really an error).
2003-10-30 22:03:46 +00:00
skrll
d1ef336230 Fix a typo so that hack actually takes effect. 2003-10-30 12:30:39 +00:00
scw
7a55b436b2 Move the alignment fault enable/disable code into macroes to avoid
needless duplication.

Additionally, merge AST handling into the same code.

exception.S and the generic irq_dispatch.S routines have been updated
to use the macroes.

XXX: I have patches for the non-generic IRQ dispatch routines, but they
need testing by someone with hardware.
2003-10-30 08:57:24 +00:00
scw
97e37b6030 In bus_dmamap_sync(), we can no longer rely on the data cache being
flushed on every context switch as an indicator that a mapping is
not resident in the cache.

Instead, used the per-pmap flag maintained by the cpu_switch/pmap code.
2003-10-30 08:44:13 +00:00
mycroft
1588a62950 Whitespace. 2003-10-29 05:48:19 +00:00
mycroft
2f3400cec7 The previous patch was wrong -- mcr does not output anything. Instead give a
junk input (it's not used when the last argument is 0).
2003-10-29 05:47:04 +00:00
mycroft
7a85552554 If something goes wrong, we want to return ENOMEM, not 0! 2003-10-29 05:03:41 +00:00
mycroft
a1178ff097 The uninitialized variable in this case was a bug, which could probably be
used to crash the system.
2003-10-29 04:38:50 +00:00
kleink
7b674621bf Retire FPA support from this file at last; suggested by Richard Earnshaw
and not objected to by port-arm.
2003-10-28 21:27:08 +00:00
skrll
c5a4c60e2e Compile sys/kern/uipc_socket.c -fno-strict-aliasing for now. PR 23044. 2003-10-28 20:12:00 +00:00
chs
b42acb8d26 uninitialized variable. 2003-10-28 15:31:33 +00:00
scw
fe5371e8a9 Fix an uninitialised variable warning, reported by Shoichi Miyake
in port-arm/23293.
2003-10-28 08:22:55 +00:00
kleink
060a72601c For convenient use in libc, add unions of the C floating types and their
corresponding structure definitions.
2003-10-27 10:13:48 +00:00
chris
25c741b8a6 Fix up some unitialised variables. 2003-10-26 23:11:15 +00:00
kleink
d54b367f5d Remove the FPA extended-precision format entirely; according to Richard
Earnshaw it was never supported by the toolchain.
2003-10-26 15:57:54 +00:00
jdolecek
85204ef973 fix NULL vs. 0 usage 2003-10-26 11:45:46 +00:00
scw
4d7283b3ec Assume that if curpcb is NULL, we're already running with alignment
faults enabled.
2003-10-26 11:34:29 +00:00