aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2005-11-07 17:08:46 -0500
committerDavid S. Miller <davem@davemloft.net>2005-11-07 17:08:46 -0500
commitb8ae48656db860d4c83a29aa7b0588fc89361935 (patch)
treedbeee0739669c6e77799b5c3a88fa27326647e20 /arch
parent5a820fa7e1a34f12fec4e6766e5c335ae9427028 (diff)
[SPARC64] mm: don't re-evaluate *ptep
sparc64 prom_callback and new_setup_frame32 each operates on a user page table without holding lock, and no doubt they've good reason. But I'd feel more confident if they were to do a "pte = *ptep" and then operate on pte, rather than re-evaluating *ptep. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc64/kernel/setup.c12
-rw-r--r--arch/sparc64/kernel/signal32.c6
2 files changed, 12 insertions, 6 deletions
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index c1f34237cdf2..bf1849dd9c49 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -154,6 +154,7 @@ int prom_callback(long *args)
154 pud_t *pudp; 154 pud_t *pudp;
155 pmd_t *pmdp; 155 pmd_t *pmdp;
156 pte_t *ptep; 156 pte_t *ptep;
157 pte_t pte;
157 158
158 for_each_process(p) { 159 for_each_process(p) {
159 mm = p->mm; 160 mm = p->mm;
@@ -178,8 +179,9 @@ int prom_callback(long *args)
178 * being called from inside OBP. 179 * being called from inside OBP.
179 */ 180 */
180 ptep = pte_offset_map(pmdp, va); 181 ptep = pte_offset_map(pmdp, va);
181 if (pte_present(*ptep)) { 182 pte = *ptep;
182 tte = pte_val(*ptep); 183 if (pte_present(pte)) {
184 tte = pte_val(pte);
183 res = PROM_TRUE; 185 res = PROM_TRUE;
184 } 186 }
185 pte_unmap(ptep); 187 pte_unmap(ptep);
@@ -218,6 +220,7 @@ int prom_callback(long *args)
218 pud_t *pudp; 220 pud_t *pudp;
219 pmd_t *pmdp; 221 pmd_t *pmdp;
220 pte_t *ptep; 222 pte_t *ptep;
223 pte_t pte;
221 int error; 224 int error;
222 225
223 if ((va >= LOW_OBP_ADDRESS) && (va < HI_OBP_ADDRESS)) { 226 if ((va >= LOW_OBP_ADDRESS) && (va < HI_OBP_ADDRESS)) {
@@ -240,8 +243,9 @@ int prom_callback(long *args)
240 * being called from inside OBP. 243 * being called from inside OBP.
241 */ 244 */
242 ptep = pte_offset_kernel(pmdp, va); 245 ptep = pte_offset_kernel(pmdp, va);
243 if (pte_present(*ptep)) { 246 pte = *ptep;
244 tte = pte_val(*ptep); 247 if (pte_present(pte)) {
248 tte = pte_val(pte);
245 res = PROM_TRUE; 249 res = PROM_TRUE;
246 } 250 }
247 goto done; 251 goto done;
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
index aecccd0df1d1..009a86e5ded4 100644
--- a/arch/sparc64/kernel/signal32.c
+++ b/arch/sparc64/kernel/signal32.c
@@ -863,6 +863,7 @@ static void new_setup_frame32(struct k_sigaction *ka, struct pt_regs *regs,
863 pud_t *pudp = pud_offset(pgdp, address); 863 pud_t *pudp = pud_offset(pgdp, address);
864 pmd_t *pmdp = pmd_offset(pudp, address); 864 pmd_t *pmdp = pmd_offset(pudp, address);
865 pte_t *ptep; 865 pte_t *ptep;
866 pte_t pte;
866 867
867 regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2); 868 regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2);
868 869
@@ -873,9 +874,10 @@ static void new_setup_frame32(struct k_sigaction *ka, struct pt_regs *regs,
873 874
874 preempt_disable(); 875 preempt_disable();
875 ptep = pte_offset_map(pmdp, address); 876 ptep = pte_offset_map(pmdp, address);
876 if (pte_present(*ptep)) { 877 pte = *ptep;
878 if (pte_present(pte)) {
877 unsigned long page = (unsigned long) 879 unsigned long page = (unsigned long)
878 page_address(pte_page(*ptep)); 880 page_address(pte_page(pte));
879 881
880 wmb(); 882 wmb();
881 __asm__ __volatile__("flush %0 + %1" 883 __asm__ __volatile__("flush %0 + %1"