diff options
Diffstat (limited to 'arch/sparc/mm/init_64.c')
-rw-r--r-- | arch/sparc/mm/init_64.c | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 6ea73da29312..c77c7ef5d5d4 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -258,21 +258,16 @@ static inline void tsb_insert(struct tsb *ent, unsigned long tag, unsigned long | |||
258 | unsigned long _PAGE_ALL_SZ_BITS __read_mostly; | 258 | unsigned long _PAGE_ALL_SZ_BITS __read_mostly; |
259 | unsigned long _PAGE_SZBITS __read_mostly; | 259 | unsigned long _PAGE_SZBITS __read_mostly; |
260 | 260 | ||
261 | void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) | 261 | static void flush_dcache(unsigned long pfn) |
262 | { | 262 | { |
263 | struct mm_struct *mm; | 263 | struct page *page; |
264 | struct tsb *tsb; | ||
265 | unsigned long tag, flags; | ||
266 | unsigned long tsb_index, tsb_hash_shift; | ||
267 | 264 | ||
268 | if (tlb_type != hypervisor) { | 265 | page = pfn_to_page(pfn); |
269 | unsigned long pfn = pte_pfn(pte); | 266 | if (page && page_mapping(page)) { |
270 | unsigned long pg_flags; | 267 | unsigned long pg_flags; |
271 | struct page *page; | ||
272 | 268 | ||
273 | if (pfn_valid(pfn) && | 269 | pg_flags = page->flags; |
274 | (page = pfn_to_page(pfn), page_mapping(page)) && | 270 | if (pg_flags & (1UL << PG_dcache_dirty)) { |
275 | ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) { | ||
276 | int cpu = ((pg_flags >> PG_dcache_cpu_shift) & | 271 | int cpu = ((pg_flags >> PG_dcache_cpu_shift) & |
277 | PG_dcache_cpu_mask); | 272 | PG_dcache_cpu_mask); |
278 | int this_cpu = get_cpu(); | 273 | int this_cpu = get_cpu(); |
@@ -290,6 +285,21 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t p | |||
290 | put_cpu(); | 285 | put_cpu(); |
291 | } | 286 | } |
292 | } | 287 | } |
288 | } | ||
289 | |||
290 | void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) | ||
291 | { | ||
292 | struct mm_struct *mm; | ||
293 | struct tsb *tsb; | ||
294 | unsigned long tag, flags; | ||
295 | unsigned long tsb_index, tsb_hash_shift; | ||
296 | |||
297 | if (tlb_type != hypervisor) { | ||
298 | unsigned long pfn = pte_pfn(pte); | ||
299 | |||
300 | if (pfn_valid(pfn)) | ||
301 | flush_dcache(pfn); | ||
302 | } | ||
293 | 303 | ||
294 | mm = vma->vm_mm; | 304 | mm = vma->vm_mm; |
295 | 305 | ||
@@ -769,8 +779,8 @@ static int find_node(unsigned long addr) | |||
769 | return -1; | 779 | return -1; |
770 | } | 780 | } |
771 | 781 | ||
772 | static unsigned long nid_range(unsigned long start, unsigned long end, | 782 | static unsigned long long nid_range(unsigned long long start, |
773 | int *nid) | 783 | unsigned long long end, int *nid) |
774 | { | 784 | { |
775 | *nid = find_node(start); | 785 | *nid = find_node(start); |
776 | start += PAGE_SIZE; | 786 | start += PAGE_SIZE; |
@@ -788,8 +798,8 @@ static unsigned long nid_range(unsigned long start, unsigned long end, | |||
788 | return start; | 798 | return start; |
789 | } | 799 | } |
790 | #else | 800 | #else |
791 | static unsigned long nid_range(unsigned long start, unsigned long end, | 801 | static unsigned long long nid_range(unsigned long long start, |
792 | int *nid) | 802 | unsigned long long end, int *nid) |
793 | { | 803 | { |
794 | *nid = 0; | 804 | *nid = 0; |
795 | return end; | 805 | return end; |
@@ -1016,8 +1026,8 @@ static int __init grab_mlgroups(struct mdesc_handle *md) | |||
1016 | val = mdesc_get_property(md, node, "address-mask", NULL); | 1026 | val = mdesc_get_property(md, node, "address-mask", NULL); |
1017 | m->mask = *val; | 1027 | m->mask = *val; |
1018 | 1028 | ||
1019 | numadbg("MLGROUP[%d]: node[%lx] latency[%lx] " | 1029 | numadbg("MLGROUP[%d]: node[%llx] latency[%llx] " |
1020 | "match[%lx] mask[%lx]\n", | 1030 | "match[%llx] mask[%llx]\n", |
1021 | count - 1, m->node, m->latency, m->match, m->mask); | 1031 | count - 1, m->node, m->latency, m->match, m->mask); |
1022 | } | 1032 | } |
1023 | 1033 | ||
@@ -1056,7 +1066,7 @@ static int __init grab_mblocks(struct mdesc_handle *md) | |||
1056 | "address-congruence-offset", NULL); | 1066 | "address-congruence-offset", NULL); |
1057 | m->offset = *val; | 1067 | m->offset = *val; |
1058 | 1068 | ||
1059 | numadbg("MBLOCK[%d]: base[%lx] size[%lx] offset[%lx]\n", | 1069 | numadbg("MBLOCK[%d]: base[%llx] size[%llx] offset[%llx]\n", |
1060 | count - 1, m->base, m->size, m->offset); | 1070 | count - 1, m->base, m->size, m->offset); |
1061 | } | 1071 | } |
1062 | 1072 | ||
@@ -1127,7 +1137,7 @@ static int __init numa_attach_mlgroup(struct mdesc_handle *md, u64 grp, | |||
1127 | n->mask = candidate->mask; | 1137 | n->mask = candidate->mask; |
1128 | n->val = candidate->match; | 1138 | n->val = candidate->match; |
1129 | 1139 | ||
1130 | numadbg("NUMA NODE[%d]: mask[%lx] val[%lx] (latency[%lx])\n", | 1140 | numadbg("NUMA NODE[%d]: mask[%lx] val[%lx] (latency[%llx])\n", |
1131 | index, n->mask, n->val, candidate->latency); | 1141 | index, n->mask, n->val, candidate->latency); |
1132 | 1142 | ||
1133 | return 0; | 1143 | return 0; |