diff options
author | David S. Miller <davem@davemloft.net> | 2008-11-26 01:26:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-04 12:17:04 -0500 |
commit | f9aad60010efa896319ed6e908a5cb5e3a852907 (patch) | |
tree | 14725323047fdc4346373bd1fc718662ad2d1f3e /arch/sparc/include/asm/system_64.h | |
parent | 5565736e44fff06dc5f5c6559e04ac58d2d560ab (diff) |
sparc64: Block NMIs in critical section of context switch.
In these instructions we load the new thread register, switch
the register window, and setup the new frame pointer.
All of these must appear atomic, and things will explode if
we take a PIL=15 NMI interrupt in the middle of this sequence.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/include/asm/system_64.h')
-rw-r--r-- | arch/sparc/include/asm/system_64.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/system_64.h b/arch/sparc/include/asm/system_64.h index 7554ad39b5af..779cf62d3ce9 100644 --- a/arch/sparc/include/asm/system_64.h +++ b/arch/sparc/include/asm/system_64.h | |||
@@ -159,6 +159,7 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \ | |||
159 | "stb %%o5, [%%g6 + %5]\n\t" \ | 159 | "stb %%o5, [%%g6 + %5]\n\t" \ |
160 | "rdpr %%cwp, %%o5\n\t" \ | 160 | "rdpr %%cwp, %%o5\n\t" \ |
161 | "stb %%o5, [%%g6 + %8]\n\t" \ | 161 | "stb %%o5, [%%g6 + %8]\n\t" \ |
162 | "wrpr %%g0, 15, %%pil\n\t" \ | ||
162 | "mov %4, %%g6\n\t" \ | 163 | "mov %4, %%g6\n\t" \ |
163 | "ldub [%4 + %8], %%g1\n\t" \ | 164 | "ldub [%4 + %8], %%g1\n\t" \ |
164 | "wrpr %%g1, %%cwp\n\t" \ | 165 | "wrpr %%g1, %%cwp\n\t" \ |
@@ -169,6 +170,7 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \ | |||
169 | "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \ | 170 | "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \ |
170 | "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \ | 171 | "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \ |
171 | "ldx [%%g6 + %9], %%g4\n\t" \ | 172 | "ldx [%%g6 + %9], %%g4\n\t" \ |
173 | "wrpr %%g0, 14, %%pil\n\t" \ | ||
172 | "brz,pt %%o7, switch_to_pc\n\t" \ | 174 | "brz,pt %%o7, switch_to_pc\n\t" \ |
173 | " mov %%g7, %0\n\t" \ | 175 | " mov %%g7, %0\n\t" \ |
174 | "sethi %%hi(ret_from_syscall), %%g1\n\t" \ | 176 | "sethi %%hi(ret_from_syscall), %%g1\n\t" \ |