aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-02-06 18:52:05 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-20 04:11:51 -0500
commit840aaef8db32572b6d11e0d5cb5e6efcbc812000 (patch)
treeaf8b8364f314d9d71c5ae81ffb48b46c53c6ae6c
parent45fec05f805a113372c9a7ff4c653ac749f6921c (diff)
[SPARC64]: Add missing memory barriers to instruction patching functions.
V9 requires a write memory barrier before the instruction flush. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/sparc64/kernel/setup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index e22bf5fc92ce..40acac5b8337 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -529,15 +529,19 @@ static void __init per_cpu_patch(void)
529 }; 529 };
530 530
531 *(unsigned int *) (addr + 0) = insns[0]; 531 *(unsigned int *) (addr + 0) = insns[0];
532 wmb();
532 __asm__ __volatile__("flush %0" : : "r" (addr + 0)); 533 __asm__ __volatile__("flush %0" : : "r" (addr + 0));
533 534
534 *(unsigned int *) (addr + 4) = insns[1]; 535 *(unsigned int *) (addr + 4) = insns[1];
536 wmb();
535 __asm__ __volatile__("flush %0" : : "r" (addr + 4)); 537 __asm__ __volatile__("flush %0" : : "r" (addr + 4));
536 538
537 *(unsigned int *) (addr + 8) = insns[2]; 539 *(unsigned int *) (addr + 8) = insns[2];
540 wmb();
538 __asm__ __volatile__("flush %0" : : "r" (addr + 8)); 541 __asm__ __volatile__("flush %0" : : "r" (addr + 8));
539 542
540 *(unsigned int *) (addr + 12) = insns[3]; 543 *(unsigned int *) (addr + 12) = insns[3];
544 wmb();
541 __asm__ __volatile__("flush %0" : : "r" (addr + 12)); 545 __asm__ __volatile__("flush %0" : : "r" (addr + 12));
542 546
543 p++; 547 p++;
@@ -558,6 +562,7 @@ static void __init gl_patch(void)
558 unsigned long addr = p1->addr; 562 unsigned long addr = p1->addr;
559 563
560 *(unsigned int *) (addr + 0) = p1->insn; 564 *(unsigned int *) (addr + 0) = p1->insn;
565 wmb();
561 __asm__ __volatile__("flush %0" : : "r" (addr + 0)); 566 __asm__ __volatile__("flush %0" : : "r" (addr + 0));
562 567
563 p1++; 568 p1++;
@@ -568,9 +573,11 @@ static void __init gl_patch(void)
568 unsigned long addr = p2->addr; 573 unsigned long addr = p2->addr;
569 574
570 *(unsigned int *) (addr + 0) = p2->insns[0]; 575 *(unsigned int *) (addr + 0) = p2->insns[0];
576 wmb();
571 __asm__ __volatile__("flush %0" : : "r" (addr + 0)); 577 __asm__ __volatile__("flush %0" : : "r" (addr + 0));
572 578
573 *(unsigned int *) (addr + 3) = p2->insns[1]; 579 *(unsigned int *) (addr + 3) = p2->insns[1];
580 wmb();
574 __asm__ __volatile__("flush %0" : : "r" (addr + 4)); 581 __asm__ __volatile__("flush %0" : : "r" (addr + 4));
575 582
576 p2++; 583 p2++;