1. 26 4月, 2010 1 次提交
  2. 20 4月, 2010 1 次提交
  3. 19 4月, 2010 1 次提交
  4. 02 4月, 2010 1 次提交
    • P
      sh: Fix up the SH-3 build for recent TLB changes. · be97d758
      Paul Mundt 提交于
      While the MMUCR.URB and ITLB/UTLB differentiation works fine for all SH-4
      and later TLBs, these features are absent on SH-3. This splits out
      local_flush_tlb_all() in to SH-4 and PTEAEX copies while restoring the
      old SH-3 one, subsequently fixing up the build.
      
      This will probably want some further reordering and tidying in the
      future, but that's out of scope at present.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      be97d758
  5. 29 3月, 2010 1 次提交
  6. 26 3月, 2010 1 次提交
  7. 23 3月, 2010 3 次提交
  8. 10 3月, 2010 1 次提交
  9. 08 3月, 2010 1 次提交
  10. 05 3月, 2010 1 次提交
  11. 04 3月, 2010 1 次提交
    • P
      sh: fix up MMU reset with variable PMB mapping sizes. · 281983d6
      Paul Mundt 提交于
      Presently we run in to issues with the MMU resetting the CPU when
      variable sized mappings are employed. This takes a slightly more
      aggressive approach to keeping the TLB and cache state sane before
      establishing the mappings in order to cut down on races observed on
      SMP configurations.
      
      At the same time, we bump the VMA range up to the 0xb000...0xc000 range,
      as there still seems to be some undocumented behaviour in setting up
      variable mappings in the 0xa000...0xb000 range, resulting in reset by the
      TLB.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      281983d6
  12. 03 3月, 2010 2 次提交
  13. 02 3月, 2010 3 次提交
  14. 01 3月, 2010 1 次提交
  15. 23 2月, 2010 2 次提交
  16. 21 2月, 2010 1 次提交
    • R
      MM: Pass a PTE pointer to update_mmu_cache() rather than the PTE itself · 4b3073e1
      Russell King 提交于
      On VIVT ARM, when we have multiple shared mappings of the same file
      in the same MM, we need to ensure that we have coherency across all
      copies.  We do this via make_coherent() by making the pages
      uncacheable.
      
      This used to work fine, until we allowed highmem with highpte - we
      now have a page table which is mapped as required, and is not available
      for modification via update_mmu_cache().
      
      Ralf Beache suggested getting rid of the PTE value passed to
      update_mmu_cache():
      
        On MIPS update_mmu_cache() calls __update_tlb() which walks pagetables
        to construct a pointer to the pte again.  Passing a pte_t * is much
        more elegant.  Maybe we might even replace the pte argument with the
        pte_t?
      
      Ben Herrenschmidt would also like the pte pointer for PowerPC:
      
        Passing the ptep in there is exactly what I want.  I want that
        -instead- of the PTE value, because I have issue on some ppc cases,
        for I$/D$ coherency, where set_pte_at() may decide to mask out the
        _PAGE_EXEC.
      
      So, pass in the mapped page table pointer into update_mmu_cache(), and
      remove the PTE value, updating all implementations and call sites to
      suit.
      
      Includes a fix from Stephen Rothwell:
      
        sparc: fix fallout from update_mmu_cache API change
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      4b3073e1
  17. 18 2月, 2010 2 次提交
    • P
      sh: Merge legacy and dynamic PMB modes. · d01447b3
      Paul Mundt 提交于
      This implements a bit of rework for the PMB code, which permits us to
      kill off the legacy PMB mode completely. Rather than trusting the boot
      loader to do the right thing, we do a quick verification of the PMB
      contents to determine whether to have the kernel setup the initial
      mappings or whether it needs to mangle them later on instead.
      
      If we're booting from legacy mappings, the kernel will now take control
      of them and make them match the kernel's initial mapping configuration.
      This is accomplished by breaking the initialization phase out in to
      multiple steps: synchronization, merging, and resizing. With the recent
      rework, the synchronization code establishes page links for compound
      mappings already, so we build on top of this for promoting mappings and
      reclaiming unused slots.
      
      At the same time, the changes introduced for the uncached helpers also
      permit us to dynamically resize the uncached mapping without any
      particular headaches. The smallest page size is more than sufficient for
      mapping all of kernel text, and as we're careful not to jump to any far
      off locations in the setup code the mapping can safely be resized
      regardless of whether we are executing from it or not.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      d01447b3
    • P
      sh: Use uncached I/O helpers in PMB setup. · 2e450643
      Paul Mundt 提交于
      The PMB code is an example of something that spends an absurd amount of
      time running uncached when only a couple of operations really need to be.
      This switches over to the shiny new uncached helpers, permitting us to
      spend far more time running cached.
      
      Additionally, MMUCR twiddling is perfectly safe from cached space given
      that it's paired with a control register barrier, so fix that up, too.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      2e450643
  18. 17 2月, 2010 6 次提交
    • P
      sh: PMB locking overhaul. · d53a0d33
      Paul Mundt 提交于
      This implements some locking for the PMB code. A high level rwlock is
      added for dealing with rw accesses on the entry map while a per-entry
      data structure spinlock is added to deal with the PMB entry changing out
      from underneath us.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      d53a0d33
    • P
      sh: Fix up dynamically created write-through PMB mappings. · 0065b967
      Paul Mundt 提交于
      Write-through PMB mappings still require the cache bit to be set, even if
      they're to be flagged with a different cache policy and bufferability
      bit. To reduce some of the confusion surrounding the flag encoding we
      centralize the cache mask based on the system cache policy while we're at
      it.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      0065b967
    • P
      sh: Build PMB entry links for existing contiguous multi-page mappings. · d7813bc9
      Paul Mundt 提交于
      This plugs in entry sizing support for existing mappings and then builds
      on top of that for linking together entries that are mapping contiguous
      areas. This will ultimately permit us to coalesce mappings and promote
      head pages while reclaiming PMB slots for dynamic remapping.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      d7813bc9
    • P
      sh: uncached mapping helpers. · 9edef286
      Paul Mundt 提交于
      This adds some helper routines for uncached mapping support. This
      simplifies some of the cases where we need to check the uncached mapping
      boundaries in addition to giving us a centralized location for building
      more complex manipulation on top of.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      9edef286
    • P
      sh: PMB tidying. · 51becfd9
      Paul Mundt 提交于
      Some overdue cleanup of the PMB code, killing off unused functionality
      and duplication sprinkled about the tree.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      51becfd9
    • P
      sh: Fix up more 64-bit pgprot truncation on SH-X2 TLB. · 7bdda620
      Paul Mundt 提交于
      Both the store queue API and the PMB remapping take unsigned long for
      their pgprot flags, which cuts off the extended protection bits. In the
      case of the PMB this isn't really a problem since the cache attribute
      bits that we care about are all in the lower 32-bits, but we do it just
      to be safe. The store queue remapping on the other hand depends on the
      extended prot bits for enabling userspace access to the mappings.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      7bdda620
  19. 16 2月, 2010 2 次提交
  20. 12 2月, 2010 1 次提交
    • P
      sh: Isolate uncached mapping support. · b0f3ae03
      Paul Mundt 提交于
      This splits out the uncached mapping support under its own config option,
      presently only used by 29-bit mode and 32-bit + PMB. This will make it
      possible to optionally add an uncached mapping on sh64 as well as booting
      without an uncached mapping for 32-bit.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      b0f3ae03
  21. 29 1月, 2010 1 次提交
  22. 26 1月, 2010 1 次提交
    • P
      sh: Mass ctrl_in/outX to __raw_read/writeX conversion. · 9d56dd3b
      Paul Mundt 提交于
      The old ctrl in/out routines are non-portable and unsuitable for
      cross-platform use. While drivers/sh has already been sanitized, there
      is still quite a lot of code that is not. This converts the arch/sh/ bits
      over, which permits us to flag the routines as deprecated whilst still
      building with -Werror for the architecture code, and to ensure that
      future users are not added.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      9d56dd3b
  23. 21 1月, 2010 2 次提交
  24. 20 1月, 2010 3 次提交
    • P
      sh: pretty print virtual memory map on boot. · 35f99c0d
      Paul Mundt 提交于
      This cribs the pretty printing from arch/x86/mm/init_32.c to dump the
      virtual memory layout on boot. This is primarily intended as a debugging
      aid, given that the newer CPUs have full control over their address space
      and as such have little to nothing in common with the legacy layout.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      35f99c0d
    • P
      sh: Correct iounmap fixmap teardown. · 920efaab
      Paul Mundt 提交于
      iounmap_fixed() had a couple of bugs in it that caused it to effectively
      fail at life. The total number of pages to unmap factored in the mapping
      offset and aligned up to the next page boundary, which doesn't match the
      ioremap_fixed() behaviour.
      
      When ioremap_fixed() pegs a slot, the address in the mapping data already
      contains the offset displacement, and the size is recorded verbatim given
      that we're only interested in total number of pages required. As such, we
      need to calculate the total number from the original size in the unmap
      path as well.
      
      At the same time, there was also an off-by-1 problem in the fixmap index
      calculation which has also been corrected.
      
      Previously subsequent remaps of an identical fixmap index would trigger
      the pte_ERROR() in set_pte_phys():
      
      	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
      	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
      	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
      	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
      	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
      	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
      
      With this patch in place, the iounmap-driven fixmap teardown actually
      does what it's supposed to do.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      920efaab
    • P
      sh: Make 29/32-bit mode check helper generally available. · 2efa53b2
      Paul Mundt 提交于
      Presently __in_29bit_mode() is only defined for the PMB case, but
      it's also easily derived from the CONFIG_29BIT and CONFIG_32BIT &&
      CONFIG_PMB=n cases.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      2efa53b2