1. 16 9月, 2016 1 次提交
  2. 22 8月, 2016 2 次提交
    • J
      arm64: apply __ro_after_init to some objects · 5a9e3e15
      Jisheng Zhang 提交于
      These objects are set during initialization, thereafter are read only.
      
      Previously I only want to mark vdso_pages, vdso_spec, vectors_page and
      cpu_ops as __read_mostly from performance point of view. Then inspired
      by Kees's patch[1] to apply more __ro_after_init for arm, I think it's
      better to mark them as __ro_after_init. What's more, I find some more
      objects are also read only after init. So apply __ro_after_init to all
      of them.
      
      This patch also removes global vdso_pagelist and tries to clean up
      vdso_spec[] assignment code.
      
      [1] http://www.spinics.net/lists/arm-kernel/msg523188.htmlAcked-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NJisheng Zhang <jszhang@marvell.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      5a9e3e15
    • K
      arm64: mm: convert __dma_* routines to use start, size · d34fdb70
      Kwangwoo Lee 提交于
      __dma_* routines have been converted to use start and size instread of
      start and end addresses. The patch was origianlly for adding
      __clean_dcache_area_poc() which will be used in pmem driver to clean
      dcache to the PoC(Point of Coherency) in arch_wb_cache_pmem().
      
      The functionality of __clean_dcache_area_poc()  was equivalent to
      __dma_clean_range(). The difference was __dma_clean_range() uses the end
      address, but __clean_dcache_area_poc() uses the size to clean.
      
      Thus, __clean_dcache_area_poc() has been revised with a fallthrough
      function of __dma_clean_range() after the change that __dma_* routines
      use start and size instead of using start and end.
      
      As a consequence of using start and size, the name of __dma_* routines
      has also been altered following the terminology below:
          area: takes a start and size
          range: takes a start and end
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NKwangwoo Lee <kwangwoo.lee@sk.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      d34fdb70
  3. 04 8月, 2016 1 次提交
    • K
      dma-mapping: use unsigned long for dma_attrs · 00085f1e
      Krzysztof Kozlowski 提交于
      The dma-mapping core and the implementations do not change the DMA
      attributes passed by pointer.  Thus the pointer can point to const data.
      However the attributes do not have to be a bitfield.  Instead unsigned
      long will do fine:
      
      1. This is just simpler.  Both in terms of reading the code and setting
         attributes.  Instead of initializing local attributes on the stack
         and passing pointer to it to dma_set_attr(), just set the bits.
      
      2. It brings safeness and checking for const correctness because the
         attributes are passed by value.
      
      Semantic patches for this change (at least most of them):
      
          virtual patch
          virtual context
      
          @r@
          identifier f, attrs;
      
          @@
          f(...,
          - struct dma_attrs *attrs
          + unsigned long attrs
          , ...)
          {
          ...
          }
      
          @@
          identifier r.f;
          @@
          f(...,
          - NULL
          + 0
           )
      
      and
      
          // Options: --all-includes
          virtual patch
          virtual context
      
          @r@
          identifier f, attrs;
          type t;
      
          @@
          t f(..., struct dma_attrs *attrs);
      
          @@
          identifier r.f;
          @@
          f(...,
          - NULL
          + 0
           )
      
      Link: http://lkml.kernel.org/r/1468399300-5399-2-git-send-email-k.kozlowski@samsung.comSigned-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Acked-by: NVineet Gupta <vgupta@synopsys.com>
      Acked-by: NRobin Murphy <robin.murphy@arm.com>
      Acked-by: NHans-Christian Noren Egtvedt <egtvedt@samfundet.no>
      Acked-by: Mark Salter <msalter@redhat.com> [c6x]
      Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> [cris]
      Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> [drm]
      Reviewed-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Acked-by: Joerg Roedel <jroedel@suse.de> [iommu]
      Acked-by: Fabien Dessenne <fabien.dessenne@st.com> [bdisp]
      Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com> [vb2-core]
      Acked-by: David Vrabel <david.vrabel@citrix.com> [xen]
      Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> [xen swiotlb]
      Acked-by: Joerg Roedel <jroedel@suse.de> [iommu]
      Acked-by: Richard Kuo <rkuo@codeaurora.org> [hexagon]
      Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
      Acked-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> [s390]
      Acked-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> [avr32]
      Acked-by: Vineet Gupta <vgupta@synopsys.com> [arc]
      Acked-by: Robin Murphy <robin.murphy@arm.com> [arm64 and dma-iommu]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      00085f1e
  4. 09 7月, 2016 1 次提交
    • L
      arm64: mm: change IOMMU notifier action to attach DMA ops · 16c11325
      Lorenzo Pieralisi 提交于
      Current bus notifier in ARM64 (__iommu_attach_notifier)
      attempts to attach dma_ops to a device on BUS_NOTIFY_ADD_DEVICE
      action notification.
      
      This will cause issues on ACPI based systems, where PCI devices
      can be added before the IOMMUs the devices are attached to
      had a chance to be probed, causing failures on attempts to
      attach dma_ops in that the domain for the respective IOMMU
      may not be set-up yet by the time the bus notifier is run.
      
      Devices dma_ops do not require to be set-up till the matching
      device drivers are probed. This means that instead of running
      the notifier attaching dma_ops to devices (__iommu_attach_notifier)
      on BUS_NOTIFY_ADD_DEVICE action, it can be run just before the
      device driver is bound to the device in question (on action
      BUS_NOTIFY_BIND_DRIVER) so that it is certain that its IOMMU
      group and domain are set-up accordingly at the time the
      notifier is triggered.
      
      This patch changes the notifier action upon which dma_ops
      are attached to devices and defer it to driver binding time,
      so that IOMMU devices have a chance to be probed and to register
      their bus notifiers before the dma_ops attach sequence for a
      device is actually carried out.
      
      As a result we also no longer need worry about racing with
      iommu_bus_notifier(), or about retrying the queue in case devices
      were added too early on DT-based systems, so clean up the notifier
      itself plus the additional workaround from 722ec35f ("arm64:
      dma-mapping: fix handling of devices registered before arch_initcall")
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Cc: Marek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      [rm: get rid of other now-redundant bits]
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      16c11325
  5. 21 6月, 2016 1 次提交
  6. 09 5月, 2016 2 次提交
  7. 22 4月, 2016 2 次提交
  8. 17 2月, 2016 1 次提交
  9. 02 12月, 2015 1 次提交
  10. 17 11月, 2015 1 次提交
    • A
      arm64: simplify dma_get_ops · 1dccb598
      Arnd Bergmann 提交于
      Including linux/acpi.h from asm/dma-mapping.h causes tons of compile-time
      warnings, e.g.
      
       drivers/isdn/mISDN/dsp_ecdis.h:43:0: warning: "FALSE" redefined
       drivers/isdn/mISDN/dsp_ecdis.h:44:0: warning: "TRUE" redefined
       drivers/net/fddi/skfp/h/targetos.h:62:0: warning: "TRUE" redefined
       drivers/net/fddi/skfp/h/targetos.h:63:0: warning: "FALSE" redefined
      
      However, it looks like the dependency should not even there as
      I do not see why __generic_dma_ops() cares about whether we have
      an ACPI based system or not.
      
      The current behavior is to fall back to the global dma_ops when
      a device has not set its own dma_ops, but only for DT based systems.
      This seems dangerous, as a random device might have different
      requirements regarding IOMMU or coherency, so we should really
      never have that fallback and just forbid DMA when we have not
      initialized DMA for a device.
      
      This removes the global dma_ops variable and the special-casing
      for ACPI, and just returns the dma ops that got set for the
      device, or the dummy_dma_ops if none were present.
      
      The original code has apparently been copied from arm32 where we
      rely on it for ISA devices things like the floppy controller, but
      we should have no such devices on ARM64.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      [catalin.marinas@arm.com: removed acpi_disabled check in arch_setup_dma_ops()]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      1dccb598
  11. 16 11月, 2015 1 次提交
  12. 08 11月, 2015 1 次提交
  13. 07 11月, 2015 1 次提交
    • M
      mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep... · d0164adc
      Mel Gorman 提交于
      mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd
      
      __GFP_WAIT has been used to identify atomic context in callers that hold
      spinlocks or are in interrupts.  They are expected to be high priority and
      have access one of two watermarks lower than "min" which can be referred
      to as the "atomic reserve".  __GFP_HIGH users get access to the first
      lower watermark and can be called the "high priority reserve".
      
      Over time, callers had a requirement to not block when fallback options
      were available.  Some have abused __GFP_WAIT leading to a situation where
      an optimisitic allocation with a fallback option can access atomic
      reserves.
      
      This patch uses __GFP_ATOMIC to identify callers that are truely atomic,
      cannot sleep and have no alternative.  High priority users continue to use
      __GFP_HIGH.  __GFP_DIRECT_RECLAIM identifies callers that can sleep and
      are willing to enter direct reclaim.  __GFP_KSWAPD_RECLAIM to identify
      callers that want to wake kswapd for background reclaim.  __GFP_WAIT is
      redefined as a caller that is willing to enter direct reclaim and wake
      kswapd for background reclaim.
      
      This patch then converts a number of sites
      
      o __GFP_ATOMIC is used by callers that are high priority and have memory
        pools for those requests. GFP_ATOMIC uses this flag.
      
      o Callers that have a limited mempool to guarantee forward progress clear
        __GFP_DIRECT_RECLAIM but keep __GFP_KSWAPD_RECLAIM. bio allocations fall
        into this category where kswapd will still be woken but atomic reserves
        are not used as there is a one-entry mempool to guarantee progress.
      
      o Callers that are checking if they are non-blocking should use the
        helper gfpflags_allow_blocking() where possible. This is because
        checking for __GFP_WAIT as was done historically now can trigger false
        positives. Some exceptions like dm-crypt.c exist where the code intent
        is clearer if __GFP_DIRECT_RECLAIM is used instead of the helper due to
        flag manipulations.
      
      o Callers that built their own GFP flags instead of starting with GFP_KERNEL
        and friends now also need to specify __GFP_KSWAPD_RECLAIM.
      
      The first key hazard to watch out for is callers that removed __GFP_WAIT
      and was depending on access to atomic reserves for inconspicuous reasons.
      In some cases it may be appropriate for them to use __GFP_HIGH.
      
      The second key hazard is callers that assembled their own combination of
      GFP flags instead of starting with something like GFP_KERNEL.  They may
      now wish to specify __GFP_KSWAPD_RECLAIM.  It's almost certainly harmless
      if it's missed in most cases as other activity will wake kswapd.
      Signed-off-by: NMel Gorman <mgorman@techsingularity.net>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Vitaly Wool <vitalywool@gmail.com>
      Cc: Rik van Riel <riel@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d0164adc
  14. 15 10月, 2015 2 次提交
  15. 14 9月, 2015 1 次提交
  16. 03 8月, 2015 1 次提交
  17. 27 7月, 2015 2 次提交
  18. 15 6月, 2015 1 次提交
  19. 30 4月, 2015 1 次提交
    • D
      arm64: add missing PAGE_ALIGN() to __dma_free() · 2cff98b9
      Dean Nelson 提交于
      __dma_alloc() does a PAGE_ALIGN() on the passed in size argument before
      doing anything else. __dma_free() does not. And because it doesn't, it is
      possible to leak memory should size not be an integer multiple of PAGE_SIZE.
      
      The solution is to add a PAGE_ALIGN() to __dma_free() like is done in
      __dma_alloc().
      
      Additionally, this patch removes a redundant PAGE_ALIGN() from
      __dma_alloc_coherent(), since __dma_alloc_coherent() can only be called
      from __dma_alloc(), which already does a PAGE_ALIGN() before the call.
      
      Cc: stable@vger.kernel.org
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NDean Nelson <dnelson@redhat.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      2cff98b9
  20. 27 4月, 2015 1 次提交
    • M
      arm64: dma-mapping: always clear allocated buffers · 6829e274
      Marek Szyprowski 提交于
      Buffers allocated by dma_alloc_coherent() are always zeroed on Alpha,
      ARM (32bit), MIPS, PowerPC, x86/x86_64 and probably other architectures.
      It turned out that some drivers rely on this 'feature'. Allocated buffer
      might be also exposed to userspace with dma_mmap() call, so clearing it
      is desired from security point of view to avoid exposing random memory
      to userspace. This patch unifies dma_alloc_coherent() behavior on ARM64
      architecture with other implementations by unconditionally zeroing
      allocated buffer.
      
      Cc: <stable@vger.kernel.org> # v3.14+
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      6829e274
  21. 21 3月, 2015 1 次提交
  22. 28 2月, 2015 1 次提交
  23. 24 1月, 2015 1 次提交
  24. 10 10月, 2014 1 次提交
  25. 02 10月, 2014 1 次提交
  26. 22 9月, 2014 1 次提交
  27. 09 5月, 2014 1 次提交
    • C
      arm64: Clean up the default pgprot setting · a501e324
      Catalin Marinas 提交于
      The primary aim of this patchset is to remove the pgprot_default and
      prot_sect_default global variables and rely strictly on predefined
      values. The original goal was to be able to run SMP kernels on UP
      hardware by not setting the Shareability bit. However, it is unlikely to
      see UP ARMv8 hardware and even if we do, the Shareability bit is no
      longer assumed to disable cacheable accesses.
      
      A side effect is that the device mappings now have the Shareability
      attribute set. The hardware, however, should ignore it since Device
      accesses are always Outer Shareable.
      
      Following the removal of the two global variables, there is some PROT_*
      macro reshuffling and cleanup, including the __PAGE_* macros (replaced
      by PAGE_*).
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      a501e324
  28. 04 5月, 2014 2 次提交
  29. 24 3月, 2014 3 次提交
  30. 28 2月, 2014 1 次提交
  31. 27 2月, 2014 2 次提交