aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>2016-03-24 02:07:57 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2016-07-21 06:13:28 -0400
commit0eab46be21449f1612791201aa029facb676bd31 (patch)
treeec23ccf83fe827e4ec636293fab7ceaece0fadf4 /arch/powerpc/mm
parent31278b17a0dfed3014786b623fd07ee110b801da (diff)
powerpc/mm: Add memory barrier in __hugepte_alloc()
__hugepte_alloc() uses kmem_cache_zalloc() to allocate a zeroed PTE and proceeds to use the newly allocated PTE. Add a memory barrier to make sure that the other CPUs see a properly initialized PTE. Based on a fix suggested by James Dykman. Reported-by: James Dykman <jdykman@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Tested-by: James Dykman <jdykman@us.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/hugetlbpage.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 5aac1a3f86cd..6be21e0f9095 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -81,6 +81,13 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp,
81 if (! new) 81 if (! new)
82 return -ENOMEM; 82 return -ENOMEM;
83 83
84 /*
85 * Make sure other cpus find the hugepd set only after a
86 * properly initialized page table is visible to them.
87 * For more details look for comment in __pte_alloc().
88 */
89 smp_wmb();
90
84 spin_lock(&mm->page_table_lock); 91 spin_lock(&mm->page_table_lock);
85#ifdef CONFIG_PPC_FSL_BOOK3E 92#ifdef CONFIG_PPC_FSL_BOOK3E
86 /* 93 /*