aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge G. Davis <davis_g@mvista.com>2005-10-10 05:17:44 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-10-10 05:17:44 -0400
commit19da83f632d235fff9f94671d2e2cf87d27a2446 (patch)
tree7c5935b9c88497367c7da4b373c98180cafd9a2b
parent79d13b62ef9da84d3ba551caac42d6107e57208f (diff)
[ARM] 2959/1: Add test for invalid LDRD/STRD Rd cases in ARM alignment handler
Patch from George G. Davis Add test for invalid LDRD/STRD Rd cases in ARM alignment handler and restore SWP printk KERN_ERR. Signed-off-by: Steve Longerbeam <slongerbeam@mvista.com> Signed-off-by: George G. Davis <gdavis@mvista.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mm/alignment.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index 4b39d867ac14..f35e69e9c65c 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -330,6 +330,9 @@ do_alignment_ldrdstrd(unsigned long addr, unsigned long instr,
330{ 330{
331 unsigned int rd = RD_BITS(instr); 331 unsigned int rd = RD_BITS(instr);
332 332
333 if (((rd & 1) == 1) || (rd == 14))
334 goto bad;
335
333 ai_dword += 1; 336 ai_dword += 1;
334 337
335 if (user_mode(regs)) 338 if (user_mode(regs))
@@ -361,7 +364,8 @@ do_alignment_ldrdstrd(unsigned long addr, unsigned long instr,
361 } 364 }
362 365
363 return TYPE_LDST; 366 return TYPE_LDST;
364 367 bad:
368 return TYPE_ERROR;
365 fault: 369 fault:
366 return TYPE_FAULT; 370 return TYPE_FAULT;
367} 371}
@@ -663,6 +667,8 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
663 else if ((instr & 0x001000f0) == 0x000000d0 || /* LDRD */ 667 else if ((instr & 0x001000f0) == 0x000000d0 || /* LDRD */
664 (instr & 0x001000f0) == 0x000000f0) /* STRD */ 668 (instr & 0x001000f0) == 0x000000f0) /* STRD */
665 handler = do_alignment_ldrdstrd; 669 handler = do_alignment_ldrdstrd;
670 else if ((instr & 0x01f00ff0) == 0x01000090) /* SWP */
671 goto swp;
666 else 672 else
667 goto bad; 673 goto bad;
668 break; 674 break;
@@ -733,6 +739,9 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
733 do_bad_area(current, current->mm, addr, fsr, regs); 739 do_bad_area(current, current->mm, addr, fsr, regs);
734 return 0; 740 return 0;
735 741
742 swp:
743 printk(KERN_ERR "Alignment trap: not handling swp instruction\n");
744
736 bad: 745 bad:
737 /* 746 /*
738 * Oops, we didn't handle the instruction. 747 * Oops, we didn't handle the instruction.