1. 17 5月, 2016 1 次提交
    • D
      bpf: split HAVE_BPF_JIT into cBPF and eBPF variant · 6077776b
      Daniel Borkmann 提交于
      Split the HAVE_BPF_JIT into two for distinguishing cBPF and eBPF JITs.
      
      Current cBPF ones:
      
        # git grep -n HAVE_CBPF_JIT arch/
        arch/arm/Kconfig:44:    select HAVE_CBPF_JIT
        arch/mips/Kconfig:18:   select HAVE_CBPF_JIT if !CPU_MICROMIPS
        arch/powerpc/Kconfig:129:       select HAVE_CBPF_JIT
        arch/sparc/Kconfig:35:  select HAVE_CBPF_JIT
      
      Current eBPF ones:
      
        # git grep -n HAVE_EBPF_JIT arch/
        arch/arm64/Kconfig:61:  select HAVE_EBPF_JIT
        arch/s390/Kconfig:126:  select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES
        arch/x86/Kconfig:94:    select HAVE_EBPF_JIT                    if X86_64
      
      Later code also needs this facility to check for eBPF JITs.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6077776b
  2. 11 5月, 2016 1 次提交
  3. 10 5月, 2016 2 次提交
  4. 06 5月, 2016 4 次提交
    • A
      mm: thp: kvm: fix memory corruption in KVM with THP enabled · 127393fb
      Andrea Arcangeli 提交于
      After the THP refcounting change, obtaining a compound pages from
      get_user_pages() no longer allows us to assume the entire compound page
      is immediately mappable from a secondary MMU.
      
      A secondary MMU doesn't want to call get_user_pages() more than once for
      each compound page, in order to know if it can map the whole compound
      page.  So a secondary MMU needs to know from a single get_user_pages()
      invocation when it can map immediately the entire compound page to avoid
      a flood of unnecessary secondary MMU faults and spurious
      atomic_inc()/atomic_dec() (pages don't have to be pinned by MMU notifier
      users).
      
      Ideally instead of the page->_mapcount < 1 check, get_user_pages()
      should return the granularity of the "page" mapping in the "mm" passed
      to get_user_pages().  However it's non trivial change to pass the "pmd"
      status belonging to the "mm" walked by get_user_pages up the stack (up
      to the caller of get_user_pages).  So the fix just checks if there is
      not a single pte mapping on the page returned by get_user_pages, and in
      turn if the caller can assume that the whole compound page is mapped in
      the current "mm" (in a pmd_trans_huge()).  In such case the entire
      compound page is safe to map into the secondary MMU without additional
      get_user_pages() calls on the surrounding tail/head pages.  In addition
      of being faster, not having to run other get_user_pages() calls also
      reduces the memory footprint of the secondary MMU fault in case the pmd
      split happened as result of memory pressure.
      
      Without this fix after a MADV_DONTNEED (like invoked by QEMU during
      postcopy live migration or balloning) or after generic swapping (with a
      failure in split_huge_page() that would only result in pmd splitting and
      not a physical page split), KVM would map the whole compound page into
      the shadow pagetables, despite regular faults or userfaults (like
      UFFDIO_COPY) may map regular pages into the primary MMU as result of the
      pte faults, leading to the guest mode and userland mode going out of
      sync and not working on the same memory at all times.
      
      Any other secondary MMU notifier manager (KVM is just one of the many
      MMU notifier users) will need the same information if it doesn't want to
      run a flood of get_user_pages_fast and it can support multiple
      granularity in the secondary MMU mappings, so I think it is justified to
      be exposed not just to KVM.
      
      The other option would be to move transparent_hugepage_adjust to
      mm/huge_memory.c but that currently has all kind of KVM data structures
      in it, so it's definitely not a cut-and-paste work, so I couldn't do a
      fix as cleaner as this one for 4.6.
      Signed-off-by: NAndrea Arcangeli <aarcange@redhat.com>
      Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: "Li, Liang Z" <liang.z.li@intel.com>
      Cc: Amit Shah <amit.shah@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      127393fb
    • V
      ARM: 8573/1: domain: move {set,get}_domain under config guard · ec953b70
      Vladimir Murzin 提交于
      Recursive undefined instrcution falut is seen with R-class taking an
      exception. The reson for that is __show_regs() tries to get domain
      information, but domains is not available on !MMU cores, like R/M
      class.
      
      Fix it by puting {set,get}_domain functions under CONFIG_CPU_CP15_MMU
      guard and providing stubs for the case where domains is not supported.
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      ec953b70
    • J
      ARM: 8572/1: nommu: change memory reserve for the vectors · 5b526bd9
      Jean-Philippe Brucker 提交于
      Commit 19accfd3 (ARM: move vector stubs) moved the vector stubs in an
      additional page above the base vector one. This change wasn't taken into
      account by the nommu memreserve.
      This patch ensures that the kernel won't overwrite any vector stub on
      nommu.
      
      [changed the MPU side too]
      Signed-off-by: NJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      5b526bd9
    • J
      ARM: 8571/1: nommu: fix PMSAv7 setup · 695665b0
      Jean-Philippe Brucker 提交于
      Commit 1c2f87c2 (ARM: 8025/1: Get rid of meminfo) broke the support for
      MPU on ARMv7-R. This patch adapts the code inside CONFIG_ARM_MPU to use
      memblocks appropriately.
      
      MPU initialisation only uses the first memory region, and removes all
      subsequent ones. Because looping over all regions that need removal is
      inefficient, and memblock_remove already handles memory ranges, we can
      flatten the 'for_each_memblock' part.
      Signed-off-by: NJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      695665b0
  5. 30 4月, 2016 1 次提交
    • A
      ARM: davinci: only use NVMEM when available · 04b9665b
      Arnd Bergmann 提交于
      The davinci platform contains code that calls into the nvmem
      subsystem, but that might be a loadable module, causing a
      link error:
      
      arch/arm/mach-davinci/built-in.o: In function `davinci_get_mac_addr':
      :(.text+0x1088): undefined reference to `nvmem_device_read'
      arch/arm/mach-davinci/built-in.o: In function `read_factory_config':
      :(.text+0x214c): undefined reference to `nvmem_device_read'
      
      Also, when NVMEM is completely disabled, the functions fail with
      nonobvious error messages.
      
      This ensures we only call the API functions when the code is actually
      reachable from the board file, and otherwise prints a unique log
      message.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: bec3c11b ("misc: at24: replace memory_accessor with nvmem_device_read")
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NKevin Hilman <khilman@baylibre.com>
      04b9665b
  6. 28 4月, 2016 1 次提交
  7. 27 4月, 2016 5 次提交
  8. 25 4月, 2016 1 次提交
    • K
      ARM: EXYNOS: Properly skip unitialized parent clock in power domain on · a0a966b8
      Krzysztof Kozlowski 提交于
      We want to skip reparenting a clock on turning on power domain, if we
      do not have the parent yet. The parent is obtained when turning the
      domain off. However due to a typo, the loop is continued on IS_ERR() of
      clock being reparented, not on the IS_ERR() of the parent.
      
      Theoretically this could lead to OOPS on first turn on of a power
      domain, if there was no turn off before. Practically that should never
      happen because all power domains are turned on by default (reset value,
      bootloader does not turn off them usually) so the first action will be
      always turn off.
      
      Fixes: 29e5eea0 ("ARM: EXYNOS: Get current parent clock for power domain on/off")
      Reported-by: NVladimir Zapolskiy <vz@mleia.com>
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      a0a966b8
  9. 20 4月, 2016 5 次提交
  10. 19 4月, 2016 1 次提交
  11. 15 4月, 2016 1 次提交
  12. 14 4月, 2016 4 次提交
  13. 13 4月, 2016 3 次提交
  14. 11 4月, 2016 1 次提交
    • K
      ARM: DRA7: clockdomain: Implement timer workaround for errata i874 · 1cbabcb9
      Keerthy 提交于
      Errata Title:
      i874: TIMER5/6/7/8 interrupts not propagated
      
      Description:
      When TIMER5, TIMER6, TIMER7, or TIMER8 clocks are enabled
      (CM_IPU_TIMER5/6/7/8_CLKCTRL[0:1]MODULEMODE=0x2:ENABLE) and the CD-IPU
      is in HW_AUTO mode (CM_IPU_CLKSTCTRL[0:1]CLKTRCTRL=0x3:HW_AUTO) the
      corresponding TIMER will continue counting, but enabled interrupts
      will not be propagated to the destinations (MPU, DSP, etc) in the
      SoC until the TIMER registers are accessed from the CPUs (MPU, DSP
      etc.). This can result in missed timer interrupts.
      
      Workaround:
      In order for TIMER5/6/7/8 interrupts to be propagated and serviced
      correctly the CD_IPU domain should be set to SW_WKUP mode
      (CM_IPU_CLKSTCTRL[0:1]CLKTRCTRL=0x2:SW_WKUP).
      
      The above workaround is achieved by switching the IPU clockdomain
      flags from HWSUP_SWSUP to SWSUP only.
      Signed-off-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NSuman Anna <s-anna@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      1cbabcb9
  15. 09 4月, 2016 2 次提交
  16. 08 4月, 2016 4 次提交
    • N
      ARM: OMAP: DRA7: Provide proper class to omap2_set_globals_tap · ec490f6f
      Nishanth Menon 提交于
      When commit 06c2d368 ("ARM: OMAP: DRA7: Make use of omap_revision
      information for soc_is* calls") introduced SoC check using
      omap_revision, it missed providing DRA7 as class for initializing
      the omap_version variable. Without doing this, soc_is_dra7xx() will
      fail and as a result, omap4_pm_init_early never initializes the dra7
      erratum for CPU power state. This causes the suspend path to fail
      on DRA7 devices.
      
      Fixes: 06c2d368 ("ARM: OMAP: DRA7: Make use of omap_revision information for soc_is* calls")
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Tested-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      ec490f6f
    • N
      ARM: OMAP: DRA7: wakeupgen: Skip SAR save for wakeupgen · c783e6fd
      Nishanth Menon 提交于
      DRA7 has no SAR region for automated save and restore of wakeupgen,
      which does not make real since the SoC really does not do legacy OFF
      mode anymore. Further wakeupgen should never loose context in CSWR
      retention mode for MPU domain on DRA7 since that is the deepest state
      we will enter.
      
      So, just skip, instead of oopsing as follows while attemptint to enter
      suspend on BeagleBoard-X15.
      [   55.589771] Unable to handle kernel paging request at virtual address 00002684
      [   55.589771] pgd = ec69c000
      [...]
      [   55.589771] [<c0123cc8>] (irq_notifier) from [<c015ad70>] (notifier_call_chain+0x4c/0x8c)
      [   55.589771] [<c015ad70>] (notifier_call_chain) from [<c021469c>] (cpu_cluster_pm_enter+0x2c/0x78)
      [   55.589771] [<c021469c>] (cpu_cluster_pm_enter) from [<c0514508>] (syscore_suspend+0xb8/0x31c)
      [   55.589771] [<c0514508>] (syscore_suspend) from [<c0197d24>] (suspend_devices_and_enter+0x308/0x9e4)
      [   55.589771] [<c0197d24>] (suspend_devices_and_enter) from [<c0198a40>] (pm_suspend+0x640/0x75c)
      [   55.589771] [<c0198a40>] (pm_suspend) from [<c0196bcc>] (state_store+0x64/0xb8)
      [   55.589771] [<c0196bcc>] (state_store) from [<c0307914>] (kernfs_fop_write+0xc0/0x1bc)
      [   55.589771] [<c0307914>] (kernfs_fop_write) from [<c028ac80>] (__vfs_write+0x1c/0xd8)
      [   55.589771] [<c028ac80>] (__vfs_write) from [<c028bb70>] (vfs_write+0x90/0x16c)
      [   55.589771] [<c028bb70>] (vfs_write) from [<c028c890>] (SyS_write+0x44/0x9c)
      [   55.589771] [<c028c890>] (SyS_write) from [<c0107840>] (ret_fast_syscall+0x0/0x1c)
      [...]
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Tested-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      c783e6fd
    • N
      ARM: 8550/1: protect idiv patching against undefined gcc behavior · 208fae5c
      Nicolas Pitre 提交于
      It was reported that a kernel with CONFIG_ARM_PATCH_IDIV=y stopped
      booting when compiled with the upcoming gcc 6.  Turns out that turning
      a function address into a writable array is undefined and gcc 6 decided
      it was OK to omit the store to the first word of the function while
      still preserving the store to the second word.
      
      Even though gcc 6 is now fixed to behave more coherently, it is a
      mystery that gcc 4 and gcc 5 actually produce wanted code in the kernel.
      And in fact the reduced test case to illustrate the issue does indeed
      break with gcc < 6 as well.
      
      In any case, let's guard the kernel against undefined compiler behavior
      by hiding the nature of the array location as suggested by gcc
      developers.
      
      Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70128Signed-off-by: NNicolas Pitre <nico@linaro.org>
      Reported-by: NMarcin Juszkiewicz <mjuszkiewicz@redhat.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: stable@vger.kernel.org # v4.5
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      208fae5c
    • R
      ARM: wire up preadv2 and pwritev2 syscalls · f2335a2a
      Russell King 提交于
      Wire up the preadv2 and pwritev2 syscalls for ARM.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      f2335a2a
  17. 06 4月, 2016 1 次提交
  18. 05 4月, 2016 1 次提交
    • K
      mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros · 09cbfeaf
      Kirill A. Shutemov 提交于
      PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
      ago with promise that one day it will be possible to implement page
      cache with bigger chunks than PAGE_SIZE.
      
      This promise never materialized.  And unlikely will.
      
      We have many places where PAGE_CACHE_SIZE assumed to be equal to
      PAGE_SIZE.  And it's constant source of confusion on whether
      PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
      especially on the border between fs and mm.
      
      Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
      breakage to be doable.
      
      Let's stop pretending that pages in page cache are special.  They are
      not.
      
      The changes are pretty straight-forward:
      
       - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
      
       - page_cache_get() -> get_page();
      
       - page_cache_release() -> put_page();
      
      This patch contains automated changes generated with coccinelle using
      script below.  For some reason, coccinelle doesn't patch header files.
      I've called spatch for them manually.
      
      The only adjustment after coccinelle is revert of changes to
      PAGE_CAHCE_ALIGN definition: we are going to drop it later.
      
      There are few places in the code where coccinelle didn't reach.  I'll
      fix them manually in a separate patch.  Comments and documentation also
      will be addressed with the separate patch.
      
      virtual patch
      
      @@
      expression E;
      @@
      - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      expression E;
      @@
      - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      @@
      - PAGE_CACHE_SHIFT
      + PAGE_SHIFT
      
      @@
      @@
      - PAGE_CACHE_SIZE
      + PAGE_SIZE
      
      @@
      @@
      - PAGE_CACHE_MASK
      + PAGE_MASK
      
      @@
      expression E;
      @@
      - PAGE_CACHE_ALIGN(E)
      + PAGE_ALIGN(E)
      
      @@
      expression E;
      @@
      - page_cache_get(E)
      + get_page(E)
      
      @@
      expression E;
      @@
      - page_cache_release(E)
      + put_page(E)
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      09cbfeaf
  19. 03 4月, 2016 1 次提交