From 91b9d75edc7d9b55fc08d6f99d9cd5cba95f4003 Mon Sep 17 00:00:00 2001 From: Jake Burkholder Date: Tue, 8 Jan 2002 05:20:40 +0000 Subject: [PATCH] Use the per-cpu panic stack in the case of a fault with a bad kernel stack. --- sys/sparc64/sparc64/exception.S | 7 +++++-- sys/sparc64/sparc64/exception.s | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/sparc64/sparc64/exception.S b/sys/sparc64/sparc64/exception.S index ce0fcf4c0636..360802446d77 100644 --- a/sys/sparc64/sparc64/exception.S +++ b/sys/sparc64/sparc64/exception.S @@ -135,6 +135,10 @@ #define KSTACK_SLOP 1024 +/* + * Sanity check the kernel stack and bail out if its wrong. + * XXX: doesn't handle being on the panic stack. + */ #define KSTACK_CHECK \ dec 16, ASP_REG ; \ stx %g1, [ASP_REG + 0] ; \ @@ -206,8 +210,7 @@ ENTRY(tl1_kstack_fault) wrpr %g0, 0, %otherwin wrpr %g0, WSTATE_KERNEL, %wstate - SET(panic_stack + PANIC_STACK_PAGES * PAGE_SIZE, %g2, %g1) - sub %g1, SPOFF + CCFSZ, %sp + sub ASP_REG, SPOFF + CCFSZ, %sp clr %fp rdpr %pil, %o1 diff --git a/sys/sparc64/sparc64/exception.s b/sys/sparc64/sparc64/exception.s index ce0fcf4c0636..360802446d77 100644 --- a/sys/sparc64/sparc64/exception.s +++ b/sys/sparc64/sparc64/exception.s @@ -135,6 +135,10 @@ #define KSTACK_SLOP 1024 +/* + * Sanity check the kernel stack and bail out if its wrong. + * XXX: doesn't handle being on the panic stack. + */ #define KSTACK_CHECK \ dec 16, ASP_REG ; \ stx %g1, [ASP_REG + 0] ; \ @@ -206,8 +210,7 @@ ENTRY(tl1_kstack_fault) wrpr %g0, 0, %otherwin wrpr %g0, WSTATE_KERNEL, %wstate - SET(panic_stack + PANIC_STACK_PAGES * PAGE_SIZE, %g2, %g1) - sub %g1, SPOFF + CCFSZ, %sp + sub ASP_REG, SPOFF + CCFSZ, %sp clr %fp rdpr %pil, %o1