diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2006-10-21 18:17:35 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-10-21 18:17:35 -0400 |
commit | f8829caee311207afbc882794bdc5aa0db5caf33 (patch) | |
tree | dbadd9fa746a1a4f091bc7e240ca8d787188a913 /arch/mips/mm/pgtable-64.c | |
parent | 224dc50ece1b40f8cff5ecadd42a6b2691e231de (diff) |
[MIPS] Fix aliasing bug in copy_to_user_page / copy_from_user_page
The current implementation uses a sequence of a cacheflush and a copy.
This is racy in case of a multithreaded debuggee and renders GDB
virtually unusable.
Aside this fixes a performance hog rendering access to /proc/cmdline very
slow and resulting in a enough cache stalls for the 34K AP/SP programming
model to make the bare metal code on the non-Linux VPE miss RT deadlines.
The main part of this patch was originally written by Ralf Baechle;
Atushi Nemoto did the the debugging.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm/pgtable-64.c')
-rw-r--r-- | arch/mips/mm/pgtable-64.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/mips/mm/pgtable-64.c b/arch/mips/mm/pgtable-64.c index 44b5e97fff65..8d600d307d5d 100644 --- a/arch/mips/mm/pgtable-64.c +++ b/arch/mips/mm/pgtable-64.c | |||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
11 | #include <asm/fixmap.h> | ||
11 | #include <asm/pgtable.h> | 12 | #include <asm/pgtable.h> |
12 | 13 | ||
13 | void pgd_init(unsigned long page) | 14 | void pgd_init(unsigned long page) |
@@ -52,7 +53,17 @@ void pmd_init(unsigned long addr, unsigned long pagetable) | |||
52 | 53 | ||
53 | void __init pagetable_init(void) | 54 | void __init pagetable_init(void) |
54 | { | 55 | { |
56 | unsigned long vaddr; | ||
57 | pgd_t *pgd_base; | ||
58 | |||
55 | /* Initialize the entire pgd. */ | 59 | /* Initialize the entire pgd. */ |
56 | pgd_init((unsigned long)swapper_pg_dir); | 60 | pgd_init((unsigned long)swapper_pg_dir); |
57 | pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table); | 61 | pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table); |
62 | |||
63 | pgd_base = swapper_pg_dir; | ||
64 | /* | ||
65 | * Fixed mappings: | ||
66 | */ | ||
67 | vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; | ||
68 | fixrange_init(vaddr, 0, pgd_base); | ||
58 | } | 69 | } |