16 Apr, 2011

1 commit

  • According to Appendix F, the TLB is the primary arbiter of speculation.
    Thus, if a page has a TLB entry, it may be speculatively read into the
    cache. On linux, this can cause us incoherencies because if we're about
    to do a disk read, we call get_user_pages() to do the flush/invalidate
    in user space, but we still potentially have the user TLB entries, and
    the cache could speculate the lines back into userspace (thus causing
    stale data to be used). This is fixed by purging the TLB entries before
    we flush through the tmpalias space. Now, the only way the line could
    be re-speculated is if the user actually tries to touch it (which is not
    allowed).

    Signed-off-by: James Bottomley

    James Bottomley
     

15 Jan, 2011

1 commit

  • The kernel has an 8M tmpailas space (originally designed for copying
    and clearing pages but now only used for clearing). The idea is
    to place zeros into the cache above a physical page rather than into
    the physical page and flush the cache, because often the zeros end up
    being replaced quickly anyway.

    We can also use the tmpalias space for flushing a page. The difference
    here is that we have to do tmpalias processing in the non access data and
    instruction traps. The principle is the same: as long as we know the physical
    address and have a virtual address congruent to the real one, the flush will
    be effective.

    In order to use the tmpalias space, the icache miss path has to be enhanced to
    check for the alias region to make the fic instruction effective.

    Signed-off-by: James Bottomley

    James Bottomley
     

07 Mar, 2010

1 commit


21 Feb, 2010

1 commit

  • 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: Stephen Rothwell

    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Russell King

    Russell King
     

03 Jul, 2009

2 commits

  • The TLB flushing functions on hppa, which causes PxTLB broadcasts on the system
    bus, needs to be protected by irq-safe spinlocks to avoid irq handlers to deadlock
    the kernel. The deadlocks only happened during I/O intensive loads and triggered
    pretty seldom, which is why this bug went so long unnoticed.

    Signed-off-by: Helge Deller
    [edited to use spin_lock_irqsave on UP as well since we'd been locking there
    all this time anyway, --kyle]
    Signed-off-by: Kyle McMartin

    Helge Deller
     
  • Signed-off-by: Alexander Beregalov
    Acked-by: Matthew Wilcox
    Acked-by: Grant Grundler
    Signed-off-by: Kyle McMartin

    Alexander Beregalov
     

13 Mar, 2009

1 commit


26 Jun, 2008

1 commit


03 Feb, 2008

1 commit


22 May, 2007

1 commit

  • First thing mm.h does is including sched.h solely for can_do_mlock() inline
    function which has "current" dereference inside. By dealing with can_do_mlock()
    mm.h can be detached from sched.h which is good. See below, why.

    This patch
    a) removes unconditional inclusion of sched.h from mm.h
    b) makes can_do_mlock() normal function in mm/mlock.c
    c) exports can_do_mlock() to not break compilation
    d) adds sched.h inclusions back to files that were getting it indirectly.
    e) adds less bloated headers to some files (asm/signal.h, jiffies.h) that were
    getting them indirectly

    Net result is:
    a) mm.h users would get less code to open, read, preprocess, parse, ... if
    they don't need sched.h
    b) sched.h stops being dependency for significant number of files:
    on x86_64 allmodconfig touching sched.h results in recompile of 4083 files,
    after patch it's only 3744 (-8.3%).

    Cross-compile tested on

    all arm defconfigs, all mips defconfigs, all powerpc defconfigs,
    alpha alpha-up
    arm
    i386 i386-up i386-defconfig i386-allnoconfig
    ia64 ia64-up
    m68k
    mips
    parisc parisc-up
    powerpc powerpc-up
    s390 s390-up
    sparc sparc-up
    sparc64 sparc64-up
    um-x86_64
    x86_64 x86_64-up x86_64-defconfig x86_64-allnoconfig

    as well as my two usual configs.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

17 Feb, 2007

2 commits


04 Oct, 2006

3 commits

  • Signed-off-by: Matthew Wilcox
    Signed-off-by: Kyle McMartin

    Matthew Wilcox
     
  • Joel Soete points out that we refer to pa_tlb_lock but only define it if
    CONFIG_SMP which breaks a uniprocessor build with CONFIG_DEBUG_SPINLOCK
    enabled. No module refers to pa_tlb_lock, so we can delete the export.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Kyle McMartin

    Matthew Wilcox
     
  • This patch fixes the pa8800 at a gross level (there are still other
    subtle incoherency issues which can still cause crashes and HPMCs).

    What it does is try to force eject inequivalent aliases before they
    become visible to the L2 cache (which is where we get the incoherence
    problems).

    A new function (parisc_requires_coherency) is introduced in
    asm/processor.h to identify the pa8x00 processors (8800 and 8900)
    which have the issue.

    Signed-off-by: James Bottomley
    Signed-off-by: Kyle McMartin

    James Bottomley
     

28 Jun, 2006

2 commits


22 Apr, 2006

1 commit


31 Mar, 2006

1 commit


11 Jan, 2006

2 commits

  • Make flush_data_cache_local, flush_instruction_cache_local and
    flush_tlb_all_local take a void * so they don't have to be cast
    when using on_each_cpu(). This becomes a problem when on_each_cpu
    is a macro (as it is in current -mm).

    Also move the prototype of flush_tlb_all_local into tlbflush.h and
    remove its declaration from .c files.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Kyle McMartin

    Matthew Wilcox
     
  • Flag a whole bunch of things as __read_mostly on parisc. Also flag a few
    branches as unlikely() and cleanup a bit of code.

    Signed-off-by: Helge Deller
    Signed-off-by: Kyle McMartin

    Helge Deller
     

30 Oct, 2005

1 commit

  • There's a worrying function translation_exists in parisc cacheflush.h,
    unaffected by split ptlock since flush_dcache_page is using it on some other
    mm, without any relevant lock. Oh well, make it a slightly more robust by
    factoring the pfn check within it. And it looked liable to confuse a
    camouflaged swap or file entry with a good pte: fix that too.

    Signed-off-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     

22 Oct, 2005

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds