Skip to content
  1. Sep 25, 2014
  2. Sep 23, 2014
  3. Sep 13, 2014
    • Guy Martin's avatar
      parisc: Implement new LWS CAS supporting 64 bit operations. · 89206491
      Guy Martin authored
      
      
      The current LWS cas only works correctly for 32bit. The new LWS allows
      for CAS operations of variable size.
      
      Signed-off-by: default avatarGuy Martin <gmsoft@tuxicoman.be>
      Cc: <stable@vger.kernel.org> # 3.13+
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      89206491
    • Linus Torvalds's avatar
      Make ARCH_HAS_FAST_MULTIPLIER a real config variable · 72d93104
      Linus Torvalds authored
      
      
      It used to be an ad-hoc hack defined by the x86 version of
      <asm/bitops.h> that enabled a couple of library routines to know whether
      an integer multiply is faster than repeated shifts and additions.
      
      This just makes it use the real Kconfig system instead, and makes x86
      (which was the only architecture that did this) select the option.
      
      NOTE! Even for x86, this really is kind of wrong.  If we cared, we would
      probably not enable this for builds optimized for netburst (P4), where
      shifts-and-adds are generally faster than multiplies.  This patch does
      *not* change that kind of logic, though, it is purely a syntactic change
      with no code changes.
      
      This was triggered by the fact that we have other places that really
      want to know "do I want to expand multiples by constants by hand or
      not", particularly the hash generation code.
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      72d93104
  4. Sep 11, 2014
    • Stefano Stabellini's avatar
      xen/arm: remove mach_to_phys rbtree · d50582e0
      Stefano Stabellini authored
      
      
      Remove the rbtree used to keep track of machine to physical mappings:
      the frontend can grant the same page multiple times, leading to errors
      inserting or removing entries from the mach_to_phys tree.
      
      Linux only needed to know the physical address corresponding to a given
      machine address in swiotlb-xen. Now that swiotlb-xen can call the
      xen_dma_* functions passing the machine address directly, we can remove
      it.
      
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Tested-by: default avatarDenis Schneider <v1ne2go@gmail.com>
      d50582e0
    • Stefano Stabellini's avatar
      xen/arm: reimplement xen_dma_unmap_page & friends · 340720be
      Stefano Stabellini authored
      
      
      xen_dma_unmap_page, xen_dma_sync_single_for_cpu and
      xen_dma_sync_single_for_device are currently implemented by calling into
      the corresponding generic ARM implementation of these functions. In
      order to do this, firstly the dma_addr_t handle, that on Xen is a
      machine address, needs to be translated into a physical address.  The
      operation is expensive and inaccurate, given that a single machine
      address can correspond to multiple physical addresses in one domain,
      because the same page can be granted multiple times by the frontend.
      
      To avoid this problem, we introduce a Xen specific implementation of
      xen_dma_unmap_page, xen_dma_sync_single_for_cpu and
      xen_dma_sync_single_for_device, that can operate on machine addresses
      directly.
      
      The new implementation relies on the fact that the hypervisor creates a
      second p2m mapping of any grant pages at physical address == machine
      address of the page for dom0. Therefore we can access memory at physical
      address == dma_addr_r handle and perform the cache flushing there. Some
      cache maintenance operations require a virtual address. Instead of using
      ioremap_cache, that is not safe in interrupt context, we allocate a
      per-cpu PAGE_KERNEL scratch page and we manually update the pte for it.
      
      arm64 doesn't need cache maintenance operations on unmap for now.
      
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Tested-by: default avatarDenis Schneider <v1ne2go@gmail.com>
      340720be
    • Stefano Stabellini's avatar
      xen/arm: introduce XENFEAT_grant_map_identity · 5ebc77de
      Stefano Stabellini authored
      
      
      The flag tells us that the hypervisor maps a grant page to guest
      physical address == machine address of the page in addition to the
      normal grant mapping address. It is needed to properly issue cache
      maintenance operation at the completion of a DMA operation involving a
      foreign grant.
      
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Tested-by: default avatarDenis Schneider <v1ne2go@gmail.com>
      5ebc77de
    • Will Deacon's avatar
      arm64: flush TLS registers during exec · eb35bdd7
      Will Deacon authored
      
      
      Nathan reports that we leak TLS information from the parent context
      during an exec, as we don't clear the TLS registers when flushing the
      thread state.
      
      This patch updates the flushing code so that we:
      
        (1) Unconditionally zero the tpidr_el0 register (since this is fully
            context switched for native tasks and zeroed for compat tasks)
      
        (2) Zero the tp_value state in thread_info before clearing the
            tpidrr0_el0 register for compat tasks (since this is only writable
            by the set_tls compat syscall and therefore not fully switched).
      
      A missing compiler barrier is also added to the compat set_tls syscall.
      
      Cc: <stable@vger.kernel.org>
      Acked-by: default avatarNathan Lynch <Nathan_Lynch@mentor.com>
      Reported-by: default avatarNathan Lynch <Nathan_Lynch@mentor.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      eb35bdd7
  5. Sep 10, 2014
    • Stas Sergeev's avatar
      sh: get_user_pages_fast() must flush cache · caac7e6d
      Stas Sergeev authored
      This patch avoids fuse hangs on sh4 by flushing the cache on
      get_user_pages_fast().  This is not necessary a good thing to do, but
      get_user_pages() does this, so get_user_pages_fast() should too.
      
      Please note the patch for mips arch that addresses the similar problem:
        https://kernel.googlesource.com/pub/scm/linux/kernel/git/ralf/linux/+/linux-3.4.50%5E!/#F0
      
      
      
      They basically simply disable get_user_pages_fast() at all, using a
      fall-back to get_user_pages().  But my fix is different, it adds an
      explicit cache flushes.
      
      Signed-off-by: default avatarStas Sergeev <stsp@users.sourceforge.net>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Kamal Dasu <kdasu.kdev@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      caac7e6d
    • Stefan Bader's avatar
      x86/xen: don't copy bogus duplicate entries into kernel page tables · 0b5a5063
      Stefan Bader authored
      
      
      When RANDOMIZE_BASE (KASLR) is enabled; or the sum of all loaded
      modules exceeds 512 MiB, then loading modules fails with a warning
      (and hence a vmalloc allocation failure) because the PTEs for the
      newly-allocated vmalloc address space are not zero.
      
        WARNING: CPU: 0 PID: 494 at linux/mm/vmalloc.c:128
                 vmap_page_range_noflush+0x2a1/0x360()
      
      This is caused by xen_setup_kernel_pagetables() copying
      level2_kernel_pgt into level2_fixmap_pgt, overwriting many non-present
      entries.
      
      Without KASLR, the normal kernel image size only covers the first half
      of level2_kernel_pgt and module space starts after that.
      
      L4[511]->level3_kernel_pgt[510]->level2_kernel_pgt[  0..255]->kernel
                                                        [256..511]->module
                                [511]->level2_fixmap_pgt[  0..505]->module
      
      This allows 512 MiB of of module vmalloc space to be used before
      having to use the corrupted level2_fixmap_pgt entries.
      
      With KASLR enabled, the kernel image uses the full PUD range of 1G and
      module space starts in the level2_fixmap_pgt. So basically:
      
      L4[511]->level3_kernel_pgt[510]->level2_kernel_pgt[0..511]->kernel
                                [511]->level2_fixmap_pgt[0..505]->module
      
      And now no module vmalloc space can be used without using the corrupt
      level2_fixmap_pgt entries.
      
      Fix this by properly converting the level2_fixmap_pgt entries to MFNs,
      and setting level1_fixmap_pgt as read-only.
      
      A number of comments were also using the the wrong L3 offset for
      level2_kernel_pgt.  These have been corrected.
      
      Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: stable@vger.kernel.org
      0b5a5063
Loading