aboutsummaryrefslogtreecommitdiff
path: root/arch/sparc/mm
AgeCommit message (Collapse)Author
2012-11-16Merge branch 'arch-frv' into no-rebasesAl Viro
2012-10-16sparc64: Add global PMU register dumping via sysrq.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-14sparc64: clear syscall_noerror on the entry to syscall, not on the exitAl Viro
Move that sucker to just before TI_FPDEPTH and replace stb with sth in etrap_save(). Take current_ds to its old place, so that we don't push wsaved into TI_... flags. That allows to lose clearing syscall_noerror on return from syscall. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-10sparc64: Fix deficiencies in sun4v error reporting.David S. Miller
Missing error types, attributes, and report fields. Pad out to 64-bytes. Make string reporting cleaner and easier to extend in the future using "const char *" arrays that index by either bit position, or absolute field value. Report the raw 64-byte error report as a sequence of u64s before the annotated version. Only report fields which are valid, given the context and the attribute bits which are set. For shutdown requests, use the local copy of the error report not the one we just freed up back to the queue. Also, use orderly_poweroff() just like the Domain Services shutdown request code does. If the real-address reported is "-1" (unknown) try to disassemble the instruction to report the effective address of the access. Only do this in privileged mode. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-09sparc64: Support transparent huge pages.David Miller
This is relatively easy since PMD's now cover exactly 4MB of memory. Our PMD entries are 32-bits each, so we use a special encoding. The lowest bit, PMD_ISHUGE, determines the interpretation. This is possible because sparc64's page tables are purely software entities so we can use whatever encoding scheme we want. We just have to make the TLB miss assembler page table walkers aware of the layout. set_pmd_at() works much like set_pte_at() but it has to operate in two page from a table of non-huge PTEs, so we have to queue up TLB flushes based upon what mappings are valid in the PTE table. In the second regime we are going from huge-page to non-huge-page, and in that case we need only queue up a single TLB flush to push out the huge page mapping. We still have 5 bits remaining in the huge PMD encoding so we can very likely support any new pieces of THP state tracking that might get added in the future. With lots of help from Johannes Weiner. Signed-off-by: David S. Miller <davem@davemloft.net> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-10-09sparc64: Eliminate PTE table memory wastage.David Miller
We've split up the PTE tables so that they take up half a page instead of a full page. This is in order to facilitate transparent huge page support, which works much better if our PMDs cover 4MB instead of 8MB. What we do is have a one-behind cache for PTE table allocations in the mm struct. This logic triggers only on allocations. For example, we don't try to keep track of free'd up page table blocks in the style that the s390 port does. There were only two slightly annoying aspects to this change: 1) Changing pgtable_t to be a "pte_t *". There's all of this special logic in the TLB free paths that needed adjustments, as did the PMD populate interfaces. 2) init_new_context() needs to zap the pointer, since the mm struct just gets copied from the parent on fork. Signed-off-by: David S. Miller <davem@davemloft.net> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-10-09sparc64: Only support 4MB huge pages and 8KB base pages.David Miller
Narrowing the scope of the page size configurations will make the transparent hugepage changes much simpler. In the end what we really want to do is have the kernel support multiple huge page sizes and use whatever is appropriate as the context dictactes. Signed-off-by: David S. Miller <davem@davemloft.net> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-10-09readahead: fault retry breaks mmap file read random detectionShaohua Li
.fault now can retry. The retry can break state machine of .fault. In filemap_fault, if page is miss, ra->mmap_miss is increased. In the second try, since the page is in page cache now, ra->mmap_miss is decreased. And these are done in one fault, so we can't detect random mmap file access. Add a new flag to indicate .fault is tried once. In the second try, skip ra->mmap_miss decreasing. The filemap_fault state machine is ok with it. I only tested x86, didn't test other archs, but looks the change for other archs is obvious, but who knows :) Signed-off-by: Shaohua Li <shaohua.li@fusionio.com> Cc: Rik van Riel <riel@redhat.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-10-02sparc: fix format string argument for prom_printf()Akinobu Mita
prom_printf() takes printf style arguments. Specifing GCC's format attribute reveals that there are several wrong usages of prom_printf(). This fixes those wrong format strings and arguments, and also leaves format attributes in order to detect similar mistakes at compile time. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: sparclinux@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-06sparc64: Use cpu_pgsz_mask for linear kernel mapping config.David S. Miller
This required a little bit of reordering of how we set up the memory management early on. We now only know the final values of kern_linear_pte_xor[] after we take over the trap table and start processing TLB misses ourselves. So once we fill those values in we re-clear the kernel's 4M TSB and flush the TLBs. That way if we find we support larger than 4M pages we won't have any stale smaller page size entries in the TSB. SUN4U Panther support for larger page sizes should now be extremely trivial but I have no hardware on which to test it and I believe that some of the sun4u TLB miss assembler needs to be audited first to make sure it really can handle larger than 4M PTEs properly. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-06sparc64: Probe cpu page size support more portably.David S. Miller
On sun4v, interrogate the machine description. This code is extremely defensive in nature, and a lot of the checks can probably be removed. On sun4u things are a lot simpler. There are the page sizes all chips support, and then Panther adds 32MB and 256MB pages. Report the probed value in /proc/cpuinfo Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-06sparc64: Support 2GB and 16GB page sizes for kernel linear mappings.David S. Miller
SPARC-T4 supports 2GB pages. So convert kpte_linear_bitmap into an array of 2-bit values which index into kern_linear_pte_xor. Now kern_linear_pte_xor is used for 4 page size aligned regions, 4MB, 256MB, 2GB, and 16GB respectively. Enabling 2GB pages is currently hardcoded using a check against sun4v_chip_type. In the future this will be done more cleanly by interrogating the machine description which is the correct way to determine this kind of thing. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-15sparc64: Be less verbose during vmemmap population.David S. Miller
On a 2-node machine with 256GB of ram we get 512 lines of console output, which is just too much. This mimicks Yinghai Lu's x86 commit c2b91e2eec9678dbda274e906cc32ea8f711da3b (x86_64/mm: check and print vmemmap allocation continuous) except that we aren't ever going to get contiguous block pointers in between calls so just print when the virtual address or node changes. This decreases the output by an order of 16. Also demote this to KERN_DEBUG. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: delete dead code in show_mem()Sam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: move kmap_init() to highmem.cSam Ravnborg
Try to keep highmem support in a more central place. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: move probe_memory() to srmmu.cSam Ravnborg
Only one user so move it to the file using it. It had nothing to do in fault_32. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: centralize all mmu context handling in srmmu.cSam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: drop quicklistSam Ravnborg
The quicklist stuff is not used anymore - drop it. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: drop sparc model check in paging_initSam Ravnborg
We already check the model in head_32.S so no need to repeat the check here Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: drop sparc_unmapped_baseSam Ravnborg
The base is always the same so no need to use a variable for this. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32,leon: drop leon_init()Sam Ravnborg
This function was only used to set of_pdt_build_more to leon_node_init(). But the leon_node_init() was a nop as prom_amba_init was never assigned. Cc: Daniel Hellstrom <daniel@gaisler.com> Cc: Konrad Eisele <konrad@gaisler.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: drop fixmap.hSam Ravnborg
sparc32 does not support fixmaps - so do not pretend so by having the fixmap.h file. Move relevant parts to vaddrs.h. I looked at simplifying this even more but failed to understand the reasoning behind the extra guard page involved and due to missing testing possibilities only the trivial conversion was done. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: drop unused kmap_atomic_to_pageSam Ravnborg
No users left of this function - drop it. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: beautify srmmu_inherit_prom_mappings()Sam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: use void * in nocache get/freeSam Ravnborg
This allowed to us to kill a lot of casts, with no loss of readability in any places Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: fix coding-style in srmmu.cSam Ravnborg
Fix the most annoying issues that distracts me: - whitespace - missing space after "if" and "while" - spaces around operators and similar simple things. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: sort includes in srmmu.cSam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26sparc32: define a few srmmu functions __initSam Ravnborg
They are only used during early init so lets get rid of them after init to save some RAM. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-27sparc32: srmmu_probe now knows about leon tooSam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Daniel Hellstrom <daniel@gaisler.com> Cc: Konrad Eisele <konrad@gaisler.com>
2012-05-27sparc32: introduce run-time patching of srmmu access functionsSam Ravnborg
LEON uses a different ASI than SUN for MMUREGS Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Daniel Hellstrom <daniel@gaisler.com> Cc: Konrad Eisele <konrad@gaisler.com>
2012-05-27sparc32,leon: always include leon_smp + leon_mm in buildSam Ravnborg
Fix-up leon specific assembler to use ASI_LEON_MMUREGS Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Daniel Hellstrom <daniel@gaisler.com> Cc: Konrad Eisele <konrad@gaisler.com>
2012-05-22sparc32: use the common implementation of alloc_thread_info_node()Sam Ravnborg
With sun4c removed we can fall-back to the common implementation. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Thomas Gleixner <tglx@linutronix.de> Acked-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-21Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-nextLinus Torvalds
Pull sparc updates from David Miller: 1) Kill off support for sun4c and Cypress sun4m chips. And as a result we were able to also kill off that ugly btfixup thing that required multi-stage links of the final vmlinux image in the Kbuild system. This should make the kbuild maintainers really happy. Thanks a lot to Sam Ravnborg for his tireless efforts to get this going. 2) Convert sparc64 to nobootmem. I suspect now with sparc32 being a lot cleaner, it should be able to fall in line and modernize in this area too. 3) Make sparc32 use generic clockevents, from Tkhai Kirill. [ I fixed up the BPF rules, and tried to clean up the build rules too. But I don't have - or want - a sparc cross-build environment, so the BPF rule bug and the related build cleanup was all done with just a bare "make -n" pseudo-test. - Linus ] * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next: (110 commits) sparc32: use flushi when run-time patching in per_cpu_patch sparc32: fix cpuid_patch run-time patching sparc32: drop unused inline functions in srmmu.c sparc32: drop unused functions in pgtsrmmu.h sparc32,leon: move leon mmu functions to leon_mm.c sparc32,leon: remove duplicate definitions in leon.h sparc32,leon: remove duplicate UART register definitions sparc32,leon: move leon ASI definitions to asi.h sparc32: move trap table to a separate file sparc64: renamed ttable.S to ttable_64.S sparc32: Remove asm/sysen.h header. sparc32: Delete asm/smpprim.h sparc32: Remove unused empty_bad_page{,_table} declarations. sparc32: Kill boot_cpu_id4 sparc32: Move GET_PROCESSOR*_ID() out of asm/asmmacro.h sparc32: Remove completely unused code from asm/cache.h sparc32: Add ucmpdi2.o to obj-y instead of lib-y. sparc32: add ucmpdi2 sparc: introduce arch/sparc/Kbuild sparc: remove obsolete documentation ...
2012-05-19sparc32: drop unused inline functions in srmmu.cSam Ravnborg
When decelared inline the compiler does not warn about unused functions. But they are not used so drop them. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-19sparc32: drop unused functions in pgtsrmmu.hSam Ravnborg
One function was only used by leon - move it to a leon specific file. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-19sparc32,leon: move leon mmu functions to leon_mm.cSam Ravnborg
We already have a leaon specific file - so keep all the laon stuff in one place. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Konrad Eisele <konrad@gaisler.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-15sparc32: cleanup mm/fault_32.cSam Ravnborg
- remove unused variables - fix coding style issues that hurts my eyes Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-15sparc32: Remove cypress cpu support.David S. Miller
It's the one aberration in v8, the only cpu that didn't actually have hardware multiply and divide instructions. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Sam Ravnborg <sam@ravnborg.org>
2012-05-14sparc32: remove runtime btfix supportSam Ravnborg
- remove all uses of btfixup header - remove the btfixup header - remove the btfixup code Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-13sparc32: Move cache and TLB flushes over to method ops.David S. Miller
This eliminated most of the remaining users of btfixup. There are some complications because of the special cases we have for sun4d, leon, and some flavors of viking. It was found that there are no cases where a flush_page_for_dma method was not hooked up to something, so the "noflush" iommu methods were removed. Add some documentation to the viking_sun4d_smp_ops to describe exactly the hardware bug which causes us to need special TLB flushing on sun4d. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-13sparc32: Remove unused declarations in srmmu.cDavid S. Miller
Uses of these went away with the sun4c removal. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-13sparc32: Convert mmu_* interfaces from btfixup to method ops.David S. Miller
This set of changes displays one major danger of btfixup, interface signatures are not always type checked fully. As seen here the iounit variant of the map_dma_area routine had an incorrect type for one of it's arguments. It turns out to be harmless in this case, but just imagine trying to debug something involving this kind of problem. No thanks. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-13sparc: Kill mmu_{un,}lockarea().David S. Miller
These were used on sun4c during floppy data transfers since on that chip we had to lock the cpu mappings into the TLB because we cannot take a TLB miss during the assembler floppy interrupt handler that does the data transfer. That is no longer necessary since we've removed sun4c support, thus this stuff can disappear completely. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-13sparc32: Un-btfixup update_mmu_cache().David S. Miller
The magic Swift SRMMU code in question has not been enabled for something on the order of a decade, and it as well as it's comment is there in the history in case we ever need it again. Therefore all implementations are NOPs and we can kill this stuff off. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-13sparc32: Kill btfixup for xchg()'s 'swap' instruction.David S. Miller
We always have this instruction available, so no need to use btfixup for it any more. This also eradicates the whole of atomic_32.S and thus the __atomic_begin and __atomic_end symbols completely. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-13sparc32: drop btfixup in page_32.hSam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-13sparc32: drop btfixup in mmu_context_32.hSam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-13sparc32: drop btfixup in pgtable_32.hSam Ravnborg
Only one function left using btfixup. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-13sparc32: drop btfixup in pgalloc_32.hSam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-12sparc32: Un-btfixup more PTE constants and PTE ops.David S. Miller
pte_{filei,wrprotecti,mkcleani,mkoldi} pte_{mkwrite,mkdirty,mkyoung} Signed-off-by: David S. Miller <davem@davemloft.net>