diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc/kernel/systbls.S | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/systbls.S | 8 | ||||
-rw-r--r-- | arch/sparc64/mm/init.c | 23 |
3 files changed, 23 insertions, 12 deletions
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S index 025f4516e651..e457a40838fc 100644 --- a/arch/sparc/kernel/systbls.S +++ b/arch/sparc/kernel/systbls.S | |||
@@ -48,8 +48,8 @@ sys_call_table: | |||
48 | /*135*/ .long sys_nis_syscall, sys_mkdir, sys_rmdir, sys_utimes, sys_stat64 | 48 | /*135*/ .long sys_nis_syscall, sys_mkdir, sys_rmdir, sys_utimes, sys_stat64 |
49 | /*140*/ .long sys_sendfile64, sys_nis_syscall, sys_futex, sys_gettid, sys_getrlimit | 49 | /*140*/ .long sys_sendfile64, sys_nis_syscall, sys_futex, sys_gettid, sys_getrlimit |
50 | /*145*/ .long sys_setrlimit, sys_pivot_root, sys_prctl, sys_pciconfig_read, sys_pciconfig_write | 50 | /*145*/ .long sys_setrlimit, sys_pivot_root, sys_prctl, sys_pciconfig_read, sys_pciconfig_write |
51 | /*150*/ .long sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_poll, sys_getdents64 | 51 | /*150*/ .long sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64 |
52 | /*155*/ .long sys_fcntl64, sys_ni_syscall, sys_statfs, sys_fstatfs, sys_oldumount | 52 | /*155*/ .long sys_fcntl64, sys_inotify_rm_watch, sys_statfs, sys_fstatfs, sys_oldumount |
53 | /*160*/ .long sys_sched_setaffinity, sys_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_nis_syscall | 53 | /*160*/ .long sys_sched_setaffinity, sys_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_nis_syscall |
54 | /*165*/ .long sys_quotactl, sys_set_tid_address, sys_mount, sys_ustat, sys_setxattr | 54 | /*165*/ .long sys_quotactl, sys_set_tid_address, sys_mount, sys_ustat, sys_setxattr |
55 | /*170*/ .long sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents | 55 | /*170*/ .long sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents |
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S index bceb91a8a2bd..53eaf2345fe9 100644 --- a/arch/sparc64/kernel/systbls.S +++ b/arch/sparc64/kernel/systbls.S | |||
@@ -50,8 +50,8 @@ sys_call_table32: | |||
50 | .word sys_nis_syscall, sys32_mkdir, sys_rmdir, sys32_utimes, compat_sys_stat64 | 50 | .word sys_nis_syscall, sys32_mkdir, sys_rmdir, sys32_utimes, compat_sys_stat64 |
51 | /*140*/ .word sys32_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit | 51 | /*140*/ .word sys32_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit |
52 | .word compat_sys_setrlimit, sys_pivot_root, sys32_prctl, sys_pciconfig_read, sys_pciconfig_write | 52 | .word compat_sys_setrlimit, sys_pivot_root, sys32_prctl, sys_pciconfig_read, sys_pciconfig_write |
53 | /*150*/ .word sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_poll, sys_getdents64 | 53 | /*150*/ .word sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64 |
54 | .word compat_sys_fcntl64, sys_ni_syscall, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount | 54 | .word compat_sys_fcntl64, sys_inotify_rm_watch, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount |
55 | /*160*/ .word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall | 55 | /*160*/ .word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall |
56 | .word sys_quotactl, sys_set_tid_address, compat_sys_mount, sys_ustat, sys32_setxattr | 56 | .word sys_quotactl, sys_set_tid_address, compat_sys_mount, sys_ustat, sys32_setxattr |
57 | /*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents | 57 | /*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents |
@@ -116,8 +116,8 @@ sys_call_table: | |||
116 | .word sys_socketpair, sys_mkdir, sys_rmdir, sys_utimes, sys_stat64 | 116 | .word sys_socketpair, sys_mkdir, sys_rmdir, sys_utimes, sys_stat64 |
117 | /*140*/ .word sys_sendfile64, sys_getpeername, sys_futex, sys_gettid, sys_getrlimit | 117 | /*140*/ .word sys_sendfile64, sys_getpeername, sys_futex, sys_gettid, sys_getrlimit |
118 | .word sys_setrlimit, sys_pivot_root, sys_prctl, sys_pciconfig_read, sys_pciconfig_write | 118 | .word sys_setrlimit, sys_pivot_root, sys_prctl, sys_pciconfig_read, sys_pciconfig_write |
119 | /*150*/ .word sys_getsockname, sys_nis_syscall, sys_nis_syscall, sys_poll, sys_getdents64 | 119 | /*150*/ .word sys_getsockname, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64 |
120 | .word sys_nis_syscall, sys_ni_syscall, sys_statfs, sys_fstatfs, sys_oldumount | 120 | .word sys_nis_syscall, sys_inotify_rm_watch, sys_statfs, sys_fstatfs, sys_oldumount |
121 | /*160*/ .word sys_sched_setaffinity, sys_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_utrap_install | 121 | /*160*/ .word sys_sched_setaffinity, sys_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_utrap_install |
122 | .word sys_quotactl, sys_set_tid_address, sys_mount, sys_ustat, sys_setxattr | 122 | .word sys_quotactl, sys_set_tid_address, sys_mount, sys_ustat, sys_setxattr |
123 | /*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents | 123 | /*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents |
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 8fc413cb6acd..3fbaf342a452 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -121,15 +121,24 @@ __inline__ void flush_dcache_page_impl(struct page *page) | |||
121 | } | 121 | } |
122 | 122 | ||
123 | #define PG_dcache_dirty PG_arch_1 | 123 | #define PG_dcache_dirty PG_arch_1 |
124 | #define PG_dcache_cpu_shift 24 | ||
125 | #define PG_dcache_cpu_mask (256 - 1) | ||
126 | |||
127 | #if NR_CPUS > 256 | ||
128 | #error D-cache dirty tracking and thread_info->cpu need fixing for > 256 cpus | ||
129 | #endif | ||
124 | 130 | ||
125 | #define dcache_dirty_cpu(page) \ | 131 | #define dcache_dirty_cpu(page) \ |
126 | (((page)->flags >> 24) & (NR_CPUS - 1UL)) | 132 | (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask) |
127 | 133 | ||
128 | static __inline__ void set_dcache_dirty(struct page *page, int this_cpu) | 134 | static __inline__ void set_dcache_dirty(struct page *page, int this_cpu) |
129 | { | 135 | { |
130 | unsigned long mask = this_cpu; | 136 | unsigned long mask = this_cpu; |
131 | unsigned long non_cpu_bits = ~((NR_CPUS - 1UL) << 24UL); | 137 | unsigned long non_cpu_bits; |
132 | mask = (mask << 24) | (1UL << PG_dcache_dirty); | 138 | |
139 | non_cpu_bits = ~(PG_dcache_cpu_mask << PG_dcache_cpu_shift); | ||
140 | mask = (mask << PG_dcache_cpu_shift) | (1UL << PG_dcache_dirty); | ||
141 | |||
133 | __asm__ __volatile__("1:\n\t" | 142 | __asm__ __volatile__("1:\n\t" |
134 | "ldx [%2], %%g7\n\t" | 143 | "ldx [%2], %%g7\n\t" |
135 | "and %%g7, %1, %%g1\n\t" | 144 | "and %%g7, %1, %%g1\n\t" |
@@ -151,7 +160,7 @@ static __inline__ void clear_dcache_dirty_cpu(struct page *page, unsigned long c | |||
151 | __asm__ __volatile__("! test_and_clear_dcache_dirty\n" | 160 | __asm__ __volatile__("! test_and_clear_dcache_dirty\n" |
152 | "1:\n\t" | 161 | "1:\n\t" |
153 | "ldx [%2], %%g7\n\t" | 162 | "ldx [%2], %%g7\n\t" |
154 | "srlx %%g7, 24, %%g1\n\t" | 163 | "srlx %%g7, %4, %%g1\n\t" |
155 | "and %%g1, %3, %%g1\n\t" | 164 | "and %%g1, %3, %%g1\n\t" |
156 | "cmp %%g1, %0\n\t" | 165 | "cmp %%g1, %0\n\t" |
157 | "bne,pn %%icc, 2f\n\t" | 166 | "bne,pn %%icc, 2f\n\t" |
@@ -164,7 +173,8 @@ static __inline__ void clear_dcache_dirty_cpu(struct page *page, unsigned long c | |||
164 | "2:" | 173 | "2:" |
165 | : /* no outputs */ | 174 | : /* no outputs */ |
166 | : "r" (cpu), "r" (mask), "r" (&page->flags), | 175 | : "r" (cpu), "r" (mask), "r" (&page->flags), |
167 | "i" (NR_CPUS - 1UL) | 176 | "i" (PG_dcache_cpu_mask), |
177 | "i" (PG_dcache_cpu_shift) | ||
168 | : "g1", "g7"); | 178 | : "g1", "g7"); |
169 | } | 179 | } |
170 | 180 | ||
@@ -180,7 +190,8 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t p | |||
180 | if (pfn_valid(pfn) && | 190 | if (pfn_valid(pfn) && |
181 | (page = pfn_to_page(pfn), page_mapping(page)) && | 191 | (page = pfn_to_page(pfn), page_mapping(page)) && |
182 | ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) { | 192 | ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) { |
183 | int cpu = ((pg_flags >> 24) & (NR_CPUS - 1UL)); | 193 | int cpu = ((pg_flags >> PG_dcache_cpu_shift) & |
194 | PG_dcache_cpu_mask); | ||
184 | int this_cpu = get_cpu(); | 195 | int this_cpu = get_cpu(); |
185 | 196 | ||
186 | /* This is just to optimize away some function calls | 197 | /* This is just to optimize away some function calls |