diff options
author | David S. Miller <davem@davemloft.net> | 2009-01-20 01:44:04 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-20 01:44:04 -0500 |
commit | fcd26f7ae2ea5889134e8b3d60a42ce8b993c95f (patch) | |
tree | 1d7928ac2107d4894f7c85483feb0bfb4a43ced0 /arch/sparc | |
parent | e42650196df34789c825fa83f8bb37a5d5e52c14 (diff) |
sparc64: Fix DAX handling via userspace access from kernel.
If we do a userspace access from kernel mode, and get a
data access exception, we need to check the exception
table just like a normal fault does.
The spitfire DAX handler was doing this, but such logic
was missing from the sun4v DAX code.
Reported-by: Dennis Gilmore <dgilmore@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/traps_64.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index c2d153d46586..d809c4ebb48f 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* arch/sparc64/kernel/traps.c | 1 | /* arch/sparc64/kernel/traps.c |
2 | * | 2 | * |
3 | * Copyright (C) 1995,1997,2008 David S. Miller (davem@davemloft.net) | 3 | * Copyright (C) 1995,1997,2008,2009 David S. Miller (davem@davemloft.net) |
4 | * Copyright (C) 1997,1999,2000 Jakub Jelinek (jakub@redhat.com) | 4 | * Copyright (C) 1997,1999,2000 Jakub Jelinek (jakub@redhat.com) |
5 | */ | 5 | */ |
6 | 6 | ||
@@ -314,6 +314,21 @@ void sun4v_data_access_exception(struct pt_regs *regs, unsigned long addr, unsig | |||
314 | return; | 314 | return; |
315 | 315 | ||
316 | if (regs->tstate & TSTATE_PRIV) { | 316 | if (regs->tstate & TSTATE_PRIV) { |
317 | /* Test if this comes from uaccess places. */ | ||
318 | const struct exception_table_entry *entry; | ||
319 | |||
320 | entry = search_exception_tables(regs->tpc); | ||
321 | if (entry) { | ||
322 | /* Ouch, somebody is trying VM hole tricks on us... */ | ||
323 | #ifdef DEBUG_EXCEPTIONS | ||
324 | printk("Exception: PC<%016lx> faddr<UNKNOWN>\n", regs->tpc); | ||
325 | printk("EX_TABLE: insn<%016lx> fixup<%016lx>\n", | ||
326 | regs->tpc, entry->fixup); | ||
327 | #endif | ||
328 | regs->tpc = entry->fixup; | ||
329 | regs->tnpc = regs->tpc + 4; | ||
330 | return; | ||
331 | } | ||
317 | printk("sun4v_data_access_exception: ADDR[%016lx] " | 332 | printk("sun4v_data_access_exception: ADDR[%016lx] " |
318 | "CTX[%04x] TYPE[%04x], going.\n", | 333 | "CTX[%04x] TYPE[%04x], going.\n", |
319 | addr, ctx, type); | 334 | addr, ctx, type); |