summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-05-24 20:51:55 +0000
committermarcel <marcel@FreeBSD.org>2003-05-24 20:51:55 +0000
commit36470ce9b8bef70d3858dd33d7c354f3c79e6ff5 (patch)
tree6447ea984cae8959a091aa9a503c843dfa4bb3bd /sys/ia64
parent8bc4d4bba797a5e4f4a8e7a2f9593c56f5314b02 (diff)
downloadFreeBSD-src-36470ce9b8bef70d3858dd33d7c354f3c79e6ff5.zip
FreeBSD-src-36470ce9b8bef70d3858dd33d7c354f3c79e6ff5.tar.gz
Unconditionally restore ar.k7 (memory stack) and ar.k6 (register stack)
when returning from an interrupt. Both registers are used on interrupt to switch to the right kernel stack, but other than that they are not used. This means we only have to make sure they contain proper values while in user mode. As such, we conditionally restored these registers based on whether we returned to userland or not. A nice property of conditionally restoring ar.k6 and ar.k7 is that it introduces two invariants: ar.k6 always points to the bottom of the kernel stack and ar.k7 always points to the top of the kernel stack (immediately below the PCB we have there). However, the EPC syscall path introduces an irregularity: there's no "thin red line" between user and kernel. There's a grey area that's a couple of instructions wide. Any interruption in that grey area is bound to see an inconsistent state. One such state is that we're in kernel space for all practical purposes, but we still need to have ar.k6 and ar.k7 restored as if we're in userland. Thus: restore ar.k6 and ar.k7 unconditionally at the cost of losing a valuable invariant. Both registers now hold the extend of the usable portion of the kernel stack at any interrupt nesting, which when in userland mean the bottom and the top of the kstack.
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia64/exception.S4
-rw-r--r--sys/ia64/ia64/exception.s4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/ia64/ia64/exception.S b/sys/ia64/ia64/exception.S
index 7cef5e0..50112236 100644
--- a/sys/ia64/ia64/exception.S
+++ b/sys/ia64/ia64/exception.S
@@ -522,7 +522,7 @@ ENTRY(exception_restore, 0)
// the backing store.
{ .mmi
mov ar.rsc=r31 // setup for loadrs
-(p15) mov ar.k7=r16
+ mov ar.k7=r16
(p15) mov r13=r29
;;
}
@@ -542,7 +542,7 @@ exception_restore_restart:
;;
}
{ .mmb
-(p15) mov ar.k6=r31
+ mov ar.k6=r31
mov ar.rnat=r21
nop 0
;;
diff --git a/sys/ia64/ia64/exception.s b/sys/ia64/ia64/exception.s
index 7cef5e0..50112236 100644
--- a/sys/ia64/ia64/exception.s
+++ b/sys/ia64/ia64/exception.s
@@ -522,7 +522,7 @@ ENTRY(exception_restore, 0)
// the backing store.
{ .mmi
mov ar.rsc=r31 // setup for loadrs
-(p15) mov ar.k7=r16
+ mov ar.k7=r16
(p15) mov r13=r29
;;
}
@@ -542,7 +542,7 @@ exception_restore_restart:
;;
}
{ .mmb
-(p15) mov ar.k6=r31
+ mov ar.k6=r31
mov ar.rnat=r21
nop 0
;;
OpenPOWER on IntegriCloud