Lines Matching +full:broken +full:- +full:turn +full:- +full:around
1 // SPDX-License-Identifier: GPL-2.0
29 #include <asm/io-unit.h>
75 #define FLUSH_BEGIN(mm) if ((mm)->context != NO_CONTEXT) {
98 #define SRMMU_NOCACHE_BITMAP_SHIFT (PAGE_SHIFT - 4)
109 /* XXX should we hyper_flush_whole_icache here - Anton */
158 if (size & (minsz - 1)) { in __srmmu_get_nocache()
161 size += minsz - 1; in __srmmu_get_nocache()
168 if (offset == -1) { in __srmmu_get_nocache()
215 if (vaddr & (size - 1)) { in srmmu_free_nocache()
220 offset = (vaddr - SRMMU_NOCACHE_VADDR) >> SRMMU_NOCACHE_BITMAP_SHIFT; in srmmu_free_nocache()
243 * system RAM. -- Tomas Szepe <szepe@pinerecords.com>, June 2002
335 (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); in get_pgd_fast()
357 spin_lock(&mm->page_table_lock); in pte_alloc_one()
363 spin_unlock(&mm->page_table_lock); in pte_alloc_one()
373 spin_lock(&mm->page_table_lock); in pte_free()
376 spin_unlock(&mm->page_table_lock); in pte_free()
381 /* context handling - a dynamically sized pool is used */
382 #define NO_CONTEXT -1
400 entry->next->prev = entry->prev; in remove_from_ctx_list()
401 entry->prev->next = entry->next; in remove_from_ctx_list()
406 entry->next = head; in add_to_ctx_list()
407 (entry->prev = head->prev)->next = entry; in add_to_ctx_list()
408 head->prev = entry; in add_to_ctx_list()
422 mm->context = ctxp->ctx_number; in alloc_context()
423 ctxp->ctx_mm = mm; in alloc_context()
427 if (ctxp->ctx_mm == old_mm) in alloc_context()
428 ctxp = ctxp->next; in alloc_context()
431 flush_cache_mm(ctxp->ctx_mm); in alloc_context()
432 flush_tlb_mm(ctxp->ctx_mm); in alloc_context()
435 ctxp->ctx_mm->context = NO_CONTEXT; in alloc_context()
436 ctxp->ctx_mm = mm; in alloc_context()
437 mm->context = ctxp->ctx_number; in alloc_context()
463 clist->ctx_number = ctx; in sparc_context_init()
464 clist->ctx_mm = NULL; in sparc_context_init()
477 if (mm->context == NO_CONTEXT) { in switch_mm()
481 srmmu_ctxd_set(&srmmu_context_table[mm->context], mm->pgd); in switch_mm()
490 srmmu_set_context(mm->context); in switch_mm()
514 * 36-bit physical address on the I/O space lines... in srmmu_mapioaddr()
526 len -= PAGE_SIZE; in srmmu_mapiorange()
556 len -= PAGE_SIZE; in srmmu_unmapiorange()
598 if ((ctx1 = vma->vm_mm->context) != -1) {
671 * around 8mb mapped for us.
709 if (start > (0xffffffffUL - PMD_SIZE)) in srmmu_early_allocate_ptable_skeleton()
744 if (start > (0xffffffffUL - PMD_SIZE)) in srmmu_allocate_ptable_skeleton()
768 * This is much cleaner than poking around physical address space
782 int what; /* 0 = normal-pte, 1 = pmd-level pte, 2 = pgd-level pte */ in srmmu_inherit_prom_mappings()
786 break; /* probably wrap around */ in srmmu_inherit_prom_mappings()
798 addr = start - PAGE_SIZE; in srmmu_inherit_prom_mappings()
847 /* Create a third-level SRMMU 16MB page mapping. */
919 num_contexts = prom_getintdefault(cpunode, "mmu-nctx", 0x8); in srmmu_paging_init()
936 srmmu_inherit_prom_mappings(0xfe400000, (LINUX_OPPROM_ENDVM - PAGE_SIZE)); in srmmu_paging_init()
950 local_ops->tlb_all(); in srmmu_paging_init()
960 __fix_to_virt(__end_of_fixed_addresses - 1), FIXADDR_TOP); in srmmu_paging_init()
1001 mm->context = NO_CONTEXT; in init_new_context()
1009 if (mm->context != NO_CONTEXT) { in destroy_context()
1011 srmmu_ctxd_set(&srmmu_context_table[mm->context], srmmu_swapper_pg_dir); in destroy_context()
1014 free_context(mm->context); in destroy_context()
1016 mm->context = NO_CONTEXT; in destroy_context()
1042 vac_line_size = prom_getint(nd, "cache-line-size"); in init_vac_layout()
1043 if (vac_line_size == -1) { in init_vac_layout()
1044 prom_printf("can't determine cache-line-size, halting.\n"); in init_vac_layout()
1047 cache_lines = prom_getint(nd, "cache-nlines"); in init_vac_layout()
1048 if (cache_lines == -1) { in init_vac_layout()
1049 prom_printf("can't determine cache-nlines, halting.\n"); in init_vac_layout()
1093 #if 0 /* XXX I think this is bad news... -DaveM */ in poke_hypersparc()
1143 * The Swift branch folding logic is completely broken. At in poke_swift()
1146 * it is coming from user mode (it mis-executes the branch in in poke_swift()
1148 * hosing your machine which is completely unacceptable. Turn in poke_swift()
1200 * broken hardware, send it back and we'll give you in init_swift()
1248 FLUSH_BEGIN(vma->vm_mm) in turbosparc_flush_cache_range()
1256 FLUSH_BEGIN(vma->vm_mm) in turbosparc_flush_cache_page()
1258 if (vma->vm_flags & VM_EXEC) in turbosparc_flush_cache_page()
1264 /* TurboSparc is copy-back, if we turn it on, but this does not work. */
1299 FLUSH_BEGIN(vma->vm_mm) in turbosparc_flush_tlb_range()
1306 FLUSH_BEGIN(vma->vm_mm) in turbosparc_flush_tlb_page()
1329 /* Write-back D-cache, emulate VLSI in poke_turbosparc()
1334 /* Do DVMA snooping in Dcache, Write-thru D-cache */ in poke_turbosparc()
1441 /* Must disable mixed-cmd mode here for other cpu's. */ in poke_viking()
1483 * Our workaround is to take a global spinlock around the TLB flushes,
1517 * "load from non-cacheable memory" interrupt bug. in init_viking()
1558 /* First, check for sparc-leon. */ in get_srmmu_type()
1580 prom_printf("Sparc-Linux Cypress support does not longer exit.\n"); in get_srmmu_type()
1605 if (!prom_getintdefault(cpunode, "psr-implementation", 1) && in get_srmmu_type()
1606 prom_getintdefault(cpunode, "psr-version", 1) == 5) { in get_srmmu_type()
1637 /* Local cross-calls. */
1640 xc1(local_ops->page_for_dma, page); in smp_flush_page_for_dma()
1641 local_ops->page_for_dma(page); in smp_flush_page_for_dma()
1646 xc0(local_ops->cache_all); in smp_flush_cache_all()
1647 local_ops->cache_all(); in smp_flush_cache_all()
1652 xc0(local_ops->tlb_all); in smp_flush_tlb_all()
1653 local_ops->tlb_all(); in smp_flush_tlb_all()
1663 if (mm->context != NO_CONTEXT) { in smp_flush_cache_mm()
1665 xc1(local_ops->cache_mm, (unsigned long)mm); in smp_flush_cache_mm()
1666 local_ops->cache_mm(mm); in smp_flush_cache_mm()
1672 if (mm->context != NO_CONTEXT) { in smp_flush_tlb_mm()
1674 xc1(local_ops->tlb_mm, (unsigned long)mm); in smp_flush_tlb_mm()
1675 if (atomic_read(&mm->mm_users) == 1 && current->active_mm == mm) in smp_flush_tlb_mm()
1679 local_ops->tlb_mm(mm); in smp_flush_tlb_mm()
1687 struct mm_struct *mm = vma->vm_mm; in smp_flush_cache_range()
1689 if (mm->context != NO_CONTEXT) { in smp_flush_cache_range()
1691 xc3(local_ops->cache_range, (unsigned long)vma, start, in smp_flush_cache_range()
1693 local_ops->cache_range(vma, start, end); in smp_flush_cache_range()
1701 struct mm_struct *mm = vma->vm_mm; in smp_flush_tlb_range()
1703 if (mm->context != NO_CONTEXT) { in smp_flush_tlb_range()
1705 xc3(local_ops->tlb_range, (unsigned long)vma, start, in smp_flush_tlb_range()
1707 local_ops->tlb_range(vma, start, end); in smp_flush_tlb_range()
1713 struct mm_struct *mm = vma->vm_mm; in smp_flush_cache_page()
1715 if (mm->context != NO_CONTEXT) { in smp_flush_cache_page()
1717 xc2(local_ops->cache_page, (unsigned long)vma, page); in smp_flush_cache_page()
1718 local_ops->cache_page(vma, page); in smp_flush_cache_page()
1724 struct mm_struct *mm = vma->vm_mm; in smp_flush_tlb_page()
1726 if (mm->context != NO_CONTEXT) { in smp_flush_tlb_page()
1728 xc2(local_ops->tlb_page, (unsigned long)vma, page); in smp_flush_tlb_page()
1729 local_ops->tlb_page(vma, page); in smp_flush_tlb_page()
1739 * XXX This experiment failed, research further... -DaveM in smp_flush_page_to_ram()
1742 xc1(local_ops->page_to_ram, page); in smp_flush_page_to_ram()
1744 local_ops->page_to_ram(page); in smp_flush_page_to_ram()
1750 xc2(local_ops->sig_insns, (unsigned long)mm, insn_addr); in smp_flush_sig_insns()
1751 local_ops->sig_insns(mm, insn_addr); in smp_flush_sig_insns()
1780 smp_cachetlb_ops.tlb_all = local_ops->tlb_all; in load_mmu()
1781 smp_cachetlb_ops.tlb_mm = local_ops->tlb_mm; in load_mmu()
1782 smp_cachetlb_ops.tlb_range = local_ops->tlb_range; in load_mmu()
1783 smp_cachetlb_ops.tlb_page = local_ops->tlb_page; in load_mmu()
1788 smp_cachetlb_ops.cache_all = local_ops->cache_all; in load_mmu()
1789 smp_cachetlb_ops.cache_mm = local_ops->cache_mm; in load_mmu()
1790 smp_cachetlb_ops.cache_range = local_ops->cache_range; in load_mmu()
1791 smp_cachetlb_ops.cache_page = local_ops->cache_page; in load_mmu()
1793 smp_cachetlb_ops.page_to_ram = local_ops->page_to_ram; in load_mmu()
1794 smp_cachetlb_ops.sig_insns = local_ops->sig_insns; in load_mmu()
1795 smp_cachetlb_ops.page_for_dma = local_ops->page_for_dma; in load_mmu()