Skip to content

Commit aaaaba5

Browse files
Vincent ChenGreentime Hu
authored andcommitted
nds32: Disable local irq before calling cpu_dcache_wb_page in copy_user_highpage
In order to ensure that all data in source page has been written back to memory before copy_page, the local irq shall be disabled before calling cpu_dcache_wb_page(). In addition, removing unneeded page invalidation for 'to' page. Signed-off-by: Vincent Chen <[email protected]> Reviewed-by: Greentime Hu <[email protected]> Signed-off-by: Greentime Hu <[email protected]>
1 parent 5b9f956 commit aaaaba5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/nds32/mm/cacheflush.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,9 @@ void copy_user_highpage(struct page *to, struct page *from,
175175
pto = page_to_phys(to);
176176
pfrom = page_to_phys(from);
177177

178+
local_irq_save(flags);
178179
if (aliasing(vaddr, (unsigned long)kfrom))
179180
cpu_dcache_wb_page((unsigned long)kfrom);
180-
if (aliasing(vaddr, (unsigned long)kto))
181-
cpu_dcache_inval_page((unsigned long)kto);
182-
local_irq_save(flags);
183181
vto = kremap0(vaddr, pto);
184182
vfrom = kremap1(vaddr, pfrom);
185183
copy_page((void *)vto, (void *)vfrom);

0 commit comments

Comments
 (0)