Skip to content

Commit

Permalink
[PARISC] fix panic on prefetch(NULL) on PA7300LC
Browse files Browse the repository at this point in the history
Due to an errata, the PA7300LC generates a TLB miss interruption even on the
prefetch instruction.  This means that prefetch(NULL), which is supposed to be
a nop on linux actually generates a NULL deref fault.  Fix this by testing the
address of prefetch against NULL before doing the prefetch.

Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
James Bottomley authored and James Bottomley committed May 16, 2012
1 parent 207f583 commit b3cb867
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/parisc/include/asm/prefetch.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
#define ARCH_HAS_PREFETCH
static inline void prefetch(const void *addr)
{
__asm__("ldw 0(%0), %%r0" : : "r" (addr));
__asm__(
#ifndef CONFIG_PA20
/* Need to avoid prefetch of NULL on PA7300LC */
" extrw,u,= %0,31,32,%%r0\n"
#endif
" ldw 0(%0), %%r0" : : "r" (addr));
}

/* LDD is a PA2.0 addition. */
Expand Down

0 comments on commit b3cb867

Please sign in to comment.