1. 14 8月, 2014 13 次提交
    • M
      xtensa: implement clear_user_highpage and copy_user_highpage · a91902db
      Max Filippov 提交于
      Existing clear_user_page and copy_user_page cannot be used with highmem
      because they calculate physical page address from its virtual address
      and do it incorrectly in case of high memory page mapped with
      kmap_atomic. Also kmap is not needed, as most likely userspace mapping
      color would be different from the kmapped color.
      
      Provide clear_user_highpage and copy_user_highpage functions that
      determine if temporary mapping is needed for the pages. Move most of the
      logic of the former clear_user_page and copy_user_page to
      xtensa/mm/cache.c only leaving temporary mapping setup, invalidation and
      clearing/copying in the xtensa/mm/misc.S. Rename these functions to
      clear_page_alias and copy_page_alias.
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      a91902db
    • M
      xtensa: fix TLBTEMP_BASE_2 region handling in fast_second_level_miss · 7128039f
      Max Filippov 提交于
      Current definition of TLBTEMP_BASE_2 is always 32K above the
      TLBTEMP_BASE_1, whereas fast_second_level_miss handler for the TLBTEMP
      region analyzes virtual address bit (PAGE_SHIFT + DCACHE_ALIAS_ORDER)
      to determine TLBTEMP region where the fault happened. The size of the
      TLBTEMP region is also checked incorrectly: not 64K, but twice data
      cache way size (whicht may as well be less than the instruction cache
      way size).
      
      Fix TLBTEMP_BASE_2 to be TLBTEMP_BASE_1 + data cache way size.
      Provide TLBTEMP_SIZE that is a greater of doubled data cache way size or
      the instruction cache way size, and use it to determine if the second
      level TLB miss occured in the TLBTEMP region.
      
      Practical occurence of page faults in the TLBTEMP area is extremely
      rare, this code can be tested by deletion of all w[di]tlb instructions
      in the tlbtemp_mapping region.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      7128039f
    • M
      xtensa: allow fixmap and kmap span more than one page table · dec7305d
      Max Filippov 提交于
      To support aliasing cache both kmap region sizes are multiplied by the
      number of data cache colors. After that expansion page tables that cover
      kmap regions may become larger than one page. Correctly allocate and
      initialize page tables in this case.
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      dec7305d
    • M
      xtensa: make fixmap region addressing grow with index · 22def768
      Max Filippov 提交于
      It's much easier to reason about alignment and coloring of regions
      located in the fixmap when fixmap index is just a PFN within the fixmap
      region. Change fixmap addressing so that index 0 corresponds to
      FIXADDR_START instead of the FIXADDR_TOP.
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      22def768
    • M
      xtensa: fix access to THREAD_RA/THREAD_SP/THREAD_DS · 52247123
      Max Filippov 提交于
      With SMP and a lot of debug options enabled task_struct::thread gets out
      of reach of s32i/l32i instructions with base pointing at task_struct,
      breaking build with the following messages:
      
        arch/xtensa/kernel/entry.S: Assembler messages:
        arch/xtensa/kernel/entry.S:1002: Error: operand 3 of 'l32i.n' has invalid value '1048'
        arch/xtensa/kernel/entry.S:1831: Error: operand 3 of 's32i.n' has invalid value '1040'
        arch/xtensa/kernel/entry.S:1832: Error: operand 3 of 's32i.n' has invalid value '1044'
      
      Change base to point to task_struct::thread in such cases.
      Don't use a10 in _switch_to to save/restore prev pointer as a2 is not
      clobbered.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      52247123
    • M
      xtensa: add renameat2 syscall · 89f77c6f
      Miklos Szeredi 提交于
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Cc: Chris Zankel <chris@zankel.net>
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      89f77c6f
    • A
      xtensa: fix address checks in dma_{alloc,free}_coherent · 1ca49463
      Alan Douglas 提交于
      Virtual address is translated to the XCHAL_KSEG_CACHED region in the
      dma_free_coherent, but is checked to be in the 0...XCHAL_KSEG_SIZE
      range.
      
      Change check for end of the range from 'addr >= X' to 'addr > X - 1' to
      handle the case of X == 0.
      
      Replace 'if (C) BUG();' construct with 'BUG_ON(C);'.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NAlan Douglas <adouglas@cadence.com>
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      1ca49463
    • M
      xtensa: replace IOCTL code definitions with constants · f61bf8e7
      Max Filippov 提交于
      This fixes userspace code that builds on other architectures but fails
      on xtensa due to references to structures that other architectures don't
      refer to. E.g. this fixes the following issue with python-2.7.8:
      
        python-2.7.8/Modules/termios.c:861:25: error: invalid application
           of 'sizeof' to incomplete type 'struct serial_multiport_struct'
           {"TIOCSERGETMULTI", TIOCSERGETMULTI},
        python-2.7.8/Modules/termios.c:870:25: error: invalid application
           of 'sizeof' to incomplete type 'struct serial_multiport_struct'
           {"TIOCSERSETMULTI", TIOCSERSETMULTI},
        python-2.7.8/Modules/termios.c:900:24: error: invalid application
           of 'sizeof' to incomplete type 'struct tty_struct'
           {"TIOCTTYGSTRUCT", TIOCTTYGSTRUCT},
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      f61bf8e7
    • M
      xtensa: remove orphan MATH_EMULATION symbol · ad4a96b4
      Max Filippov 提交于
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      ad4a96b4
    • M
      xtensa: select HAVE_IDE only on platforms that may have it · 4964527d
      Max Filippov 提交于
      HAVE_IDE is not a property of architecture but of a platform, and neither
      ISS or XTFPGA support it.
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      4964527d
    • M
      xtensa: sort 'select' statements in Kconfig · 920f8a39
      Max Filippov 提交于
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      920f8a39
    • M
      xtensa: make MMU-related configuration options depend on MMU · 8a9de059
      Max Filippov 提交于
      MMUv3 and HIGHMEM support are available only on configurations with MMU,
      don't show them otherwise.
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      8a9de059
    • M
      xtensa: simplify addition of new core variants · 420ae951
      Max Filippov 提交于
      Instead of adding new Kconfig options and Makefile rules for each new
      core variant provide XTENSA_VARIANT_CUSTOM variant and record variant
      name in the XTENSA_VARIANT_NAME variable. Adding new core variant now
      means providing directory structure under arch/xtensa/variant and
      specifying correct name in kernel configuration.
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      420ae951
  2. 28 7月, 2014 5 次提交
  3. 27 7月, 2014 2 次提交
    • L
      Fix gcc-4.9.0 miscompilation of load_balance() in scheduler · 2062afb4
      Linus Torvalds 提交于
      Michel Dänzer and a couple of other people reported inexplicable random
      oopses in the scheduler, and the cause turns out to be gcc mis-compiling
      the load_balance() function when debugging is enabled.  The gcc bug
      apparently goes back to gcc-4.5, but slight optimization changes means
      that it now showed up as a problem in 4.9.0 and 4.9.1.
      
      The instruction scheduling problem causes gcc to schedule a spill
      operation to before the stack frame has been created, which in turn can
      corrupt the spilled value if an interrupt comes in.  There may be other
      effects of this bug too, but that's the code generation problem seen in
      Michel's case.
      
      This is fixed in current gcc HEAD, but the workaround as suggested by
      Markus Trippelsdorf is pretty simple: use -fno-var-tracking-assignments
      when compiling the kernel, which disables the gcc code that causes the
      problem.  This can result in slightly worse debug information for
      variable accesses, but that is infinitely preferable to actual code
      generation problems.
      
      Doing this unconditionally (not just for CONFIG_DEBUG_INFO) also allows
      non-debug builds to verify that the debug build would be identical: we
      can do
      
          export GCC_COMPARE_DEBUG=1
      
      to make gcc internally verify that the result of the build is
      independent of the "-g" flag (it will make the compiler build everything
      twice, toggling the debug flag, and compare the results).
      
      Without the "-fno-var-tracking-assignments" option, the build would fail
      (even with 4.8.3 that didn't show the actual stack frame bug) with a gcc
      compare failure.
      
      See also gcc bugzilla:
      
        https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801Reported-by: NMichel Dänzer <michel@daenzer.net>
      Suggested-by: NMarkus Trippelsdorf <markus@trippelsdorf.de>
      Cc: Jakub Jelinek <jakub@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2062afb4
    • H
      mm: fix direct reclaim writeback regression · 8bdd6380
      Hugh Dickins 提交于
      Shortly before 3.16-rc1, Dave Jones reported:
      
        WARNING: CPU: 3 PID: 19721 at fs/xfs/xfs_aops.c:971
                 xfs_vm_writepage+0x5ce/0x630 [xfs]()
        CPU: 3 PID: 19721 Comm: trinity-c61 Not tainted 3.15.0+ #3
        Call Trace:
          xfs_vm_writepage+0x5ce/0x630 [xfs]
          shrink_page_list+0x8f9/0xb90
          shrink_inactive_list+0x253/0x510
          shrink_lruvec+0x563/0x6c0
          shrink_zone+0x3b/0x100
          shrink_zones+0x1f1/0x3c0
          try_to_free_pages+0x164/0x380
          __alloc_pages_nodemask+0x822/0xc90
          alloc_pages_vma+0xaf/0x1c0
          handle_mm_fault+0xa31/0xc50
        etc.
      
       970   if (WARN_ON_ONCE((current->flags & (PF_MEMALLOC|PF_KSWAPD)) ==
       971                   PF_MEMALLOC))
      
      I did not respond at the time, because a glance at the PageDirty block
      in shrink_page_list() quickly shows that this is impossible: we don't do
      writeback on file pages (other than tmpfs) from direct reclaim nowadays.
      Dave was hallucinating, but it would have been disrespectful to say so.
      
      However, my own /var/log/messages now shows similar complaints
      
        WARNING: CPU: 1 PID: 28814 at fs/ext4/inode.c:1881 ext4_writepage+0xa7/0x38b()
        WARNING: CPU: 0 PID: 27347 at fs/ext4/inode.c:1764 ext4_writepage+0xa7/0x38b()
      
      from stressing some mmotm trees during July.
      
      Could a dirty xfs or ext4 file page somehow get marked PageSwapBacked,
      so fail shrink_page_list()'s page_is_file_cache() test, and so proceed
      to mapping->a_ops->writepage()?
      
      Yes, 3.16-rc1's commit 68711a74 ("mm, migration: add destination
      page freeing callback") has provided such a way to compaction: if
      migrating a SwapBacked page fails, its newpage may be put back on the
      list for later use with PageSwapBacked still set, and nothing will clear
      it.
      
      Whether that can do anything worse than issue WARN_ON_ONCEs, and get
      some statistics wrong, is unclear: easier to fix than to think through
      the consequences.
      
      Fixing it here, before the put_new_page(), addresses the bug directly,
      but is probably the worst place to fix it.  Page migration is doing too
      many parts of the job on too many levels: fixing it in
      move_to_new_page() to complement its SetPageSwapBacked would be
      preferable, except why is it (and newpage->mapping and newpage->index)
      done there, rather than down in migrate_page_move_mapping(), once we are
      sure of success? Not a cleanup to get into right now, especially not
      with memcg cleanups coming in 3.17.
      Reported-by: NDave Jones <davej@redhat.com>
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8bdd6380
  4. 26 7月, 2014 13 次提交
  5. 25 7月, 2014 6 次提交
    • H
      x86: Merge tag 'ras_urgent' into x86/urgent · bf72f5de
      H. Peter Anvin 提交于
      Promote one fix for 3.16
      
      This fix was necessary after
      
      9c15a24b ("x86/mce: Improve mcheck_init_device() error handling")
      
      went in. What this patch did was, among others, check the return value
      of misc_register and exit early if it encountered an error. Original
      code sloppily didn't do that.
      
      However,
      
              cef12ee5 ("xen/mce: Add mcelog support for Xen platform")
      
      made it so that xen's init routine xen_late_init_mcelog runs first. This
      was needed for the xen mcelog device which is supposed to be independent
      from the baremetal one.
      
      Initially it was reported that misc_register() fails often on xen and
      that's why it needed fixing. However, it is *supposed* to fail by
      design, when running in dom0 so that the xen mcelog device file gets
      registered first.
      
      And *then* you need the notifier *not* unregistered on the error path so
      that the timer does get deleted properly in the CPU hotplug notifier.
      
      Btw, this fix is needed also on baremetal in the unlikely event that
      misc_register(&mce_chrdev_device) fails there too.
      
      I was unsure whether to rush it in now and decided to delay it to 3.17.
      However, xen people wanted it promoted as it breaks xen when doing cpu
      hotplug there. So, after a bit of simmering in tip/master for initial
      smoke testing, let's move it to 3.16. It fixes a semi-regression which
      got introduced in 3.16 so no need for stable tagging.
      
      tip/x86/ras contains that exact same commit but we can't remove it
      there as it is not the last one. It won't cause any merge issues, as I
      confirmed locally but I should state here the special situation of this
      one fix explicitly anyway.
      
      Thanks.
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      bf72f5de
    • J
      drm/radeon: fix cut and paste issue for hawaii. · 1b2c4869
      Jerome Glisse 提交于
      This is a halfway fix for hawaii acceleration. More fixes to come
      but hopefully isolated to userspace.
      Signed-off-by: NJérôme Glisse <jglisse@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      1b2c4869
    • D
      Merge branch 'drm-fixes-3.16' of git://people.freedesktop.org/~agd5f/linux into drm-fixes · 97cefc3e
      Dave Airlie 提交于
      two more radeon fixes.
      
      * 'drm-fixes-3.16' of git://people.freedesktop.org/~agd5f/linux:
        drm/radeon: fix irq ring buffer overflow handling
        drm/radeon: fix error handling in radeon_vm_bo_set_addr
      97cefc3e
    • D
      Merge tag 'drm-intel-fixes-2014-07-24' of git://anongit.freedesktop.org/drm-intel into drm-fixes · 9d6ed3c6
      Dave Airlie 提交于
      This time in time! Just 32bit-pae fix from Hugh, semaphores fun from Chris
      and a fix for runtime pm cherry-picked from next.
      
      Paulo is still working on a fix for runtime pm when X does cursor fun when
      the display is off, but that one isn't ready yet.
      
      * tag 'drm-intel-fixes-2014-07-24' of git://anongit.freedesktop.org/drm-intel:
        drm/i915: Simplify i915_gem_release_all_mmaps()
        drm/i915: fix freeze with blank screen booting highmem
        drm/i915: Reorder the semaphore deadlock check, again
      9d6ed3c6
    • H
      parisc: Eliminate memset after alloc_bootmem_pages · 9794144d
      HIMANGI SARAOGI 提交于
      alloc_bootmem and related function always return zeroed region of
      memory. Thus a memset after calls to these functions is unnecessary.
      
      The following Coccinelle semantic patch was used for making the change:
      
      @@
      expression E,E1;
      @@
      
      E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...)
      ... when != E
      - memset(E,0,E1);
      Signed-off-by: NHimangi Saraogi <himangi774@gmail.com>
      Acked-by: NJulia Lawall <julia.lawall@lip6.fr>
      Signed-off-by: NHelge Deller <deller@gmx.de>
      9794144d
    • J
      parisc: Remove SA_RESTORER define · 20dbea49
      John David Anglin 提交于
      The sa_restorer field in struct sigaction is obsolete and no longer in
      the parisc implementation.  However, the core code assumes the field is
      present if SA_RESTORER is defined. So, the define needs to be removed.
      Signed-off-by: NJohn David Anglin <dave.anglin@bell.net>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NHelge Deller <deller@gmx.de>
      20dbea49
  6. 24 7月, 2014 1 次提交