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. 26 7月, 2014 6 次提交
  3. 25 7月, 2014 2 次提交
  4. 24 7月, 2014 1 次提交
    • G
      sh: also try passing -m4-nofpu for SH2A builds · b1923b55
      Geert Uytterhoeven 提交于
      When compiling a SH2A kernel (e.g.  se7206_defconfig or rsk7203_defconfig)
      using sh4-linux-gcc, linking fails with:
      
        net/built-in.o: In function `__sk_run_filter':
        net/core/filter.c:566: undefined reference to `__fpscr_values'
        net/core/filter.c:269: undefined reference to `__fpscr_values'
        ...
        net/built-in.o:net/core/filter.c:580: more undefined references to `__fpscr_values' follow
      
      This happens because sh4-linux-gcc doesn't support the "-m2a-nofpu",
      which is thus filtered out by "$(call cc-option, ...)".
      
      As compiling using sh4-linux-gcc is useful for compile coverage, also
      try passing "-m4-nofpu" (which is presumably filtered out when using a
      real sh2a-linux toolchain) to disable the generation of FPU instructions
      and references to __fpscr_values[].
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Tony Breeds <tony@bakeyournoodle.com>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Daniel Borkmann <dborkman@redhat.com>
      Cc: Magnus Damm <magnus.damm@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b1923b55
  5. 23 7月, 2014 2 次提交
  6. 22 7月, 2014 8 次提交
    • S
      x86_32, entry: Store badsys error code in %eax · 8142b215
      Sven Wegener 提交于
      Commit 554086d8 ("x86_32, entry: Do syscall exit work on badsys
      (CVE-2014-4508)") introduced a regression in the x86_32 syscall entry
      code, resulting in syscall() not returning proper errors for undefined
      syscalls on CPUs supporting the sysenter feature.
      
      The following code:
      
      > int result = syscall(666);
      > printf("result=%d errno=%d error=%s\n", result, errno, strerror(errno));
      
      results in:
      
      > result=666 errno=0 error=Success
      
      Obviously, the syscall return value is the called syscall number, but it
      should have been an ENOSYS error. When run under ptrace it behaves
      correctly, which makes it hard to debug in the wild:
      
      > result=-1 errno=38 error=Function not implemented
      
      The %eax register is the return value register. For debugging via ptrace
      the syscall entry code stores the complete register context on the
      stack. The badsys handlers only store the ENOSYS error code in the
      ptrace register set and do not set %eax like a regular syscall handler
      would. The old resume_userspace call chain contains code that clobbers
      %eax and it restores %eax from the ptrace registers afterwards. The same
      goes for the ptrace-enabled call chain. When ptrace is not used, the
      syscall return value is the passed-in syscall number from the untouched
      %eax register.
      
      Use %eax as the return value register in syscall_badsys and
      sysenter_badsys, like a real syscall handler does, and have the caller
      push the value onto the stack for ptrace access.
      Signed-off-by: NSven Wegener <sven.wegener@stealer.net>
      Link: http://lkml.kernel.org/r/alpine.LNX.2.11.1407221022380.31021@titan.int.lan.stealer.netReviewed-and-tested-by: NAndy Lutomirski <luto@amacapital.net>
      Cc: <stable@vger.kernel.org> # If 554086d8 is backported
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      8142b215
    • L
      powerpc: use _GLOBAL_TOC for memmove · 6f5405bc
      Li Zhong 提交于
      memmove may be called from module code copy_pages(btrfs), and it may
      call memcpy, which may call back to C code, so it needs to use
      _GLOBAL_TOC to set up r2 correctly.
      
      This fixes following error when I tried to boot an le guest:
      
      Vector: 300 (Data Access) at [c000000073f97210]
          pc: c000000000015004: enable_kernel_altivec+0x24/0x80
          lr: c000000000058fbc: enter_vmx_copy+0x3c/0x60
          sp: c000000073f97490
         msr: 8000000002009033
         dar: d000000001d50170
       dsisr: 40000000
        current = 0xc0000000734c0000
        paca    = 0xc00000000fff0000	 softe: 0	 irq_happened: 0x01
          pid   = 815, comm = mktemp
      enter ? for help
      [c000000073f974f0] c000000000058fbc enter_vmx_copy+0x3c/0x60
      [c000000073f97510] c000000000057d34 memcpy_power7+0x274/0x840
      [c000000073f97610] d000000001c3179c copy_pages+0xfc/0x110 [btrfs]
      [c000000073f97660] d000000001c3c248 memcpy_extent_buffer+0xe8/0x160 [btrfs]
      [c000000073f97700] d000000001be4be8 setup_items_for_insert+0x208/0x4a0 [btrfs]
      [c000000073f97820] d000000001be50b4 btrfs_insert_empty_items+0xf4/0x140 [btrfs]
      [c000000073f97890] d000000001bfed30 insert_with_overflow+0x70/0x180 [btrfs]
      [c000000073f97900] d000000001bff174 btrfs_insert_dir_item+0x114/0x2f0 [btrfs]
      [c000000073f979a0] d000000001c1f92c btrfs_add_link+0x10c/0x370 [btrfs]
      [c000000073f97a40] d000000001c20e94 btrfs_create+0x204/0x270 [btrfs]
      [c000000073f97b00] c00000000026d438 vfs_create+0x178/0x210
      [c000000073f97b50] c000000000270a70 do_last+0x9f0/0xe90
      [c000000073f97c20] c000000000271010 path_openat+0x100/0x810
      [c000000073f97ce0] c000000000272ea8 do_filp_open+0x58/0xd0
      [c000000073f97dc0] c00000000025ade8 do_sys_open+0x1b8/0x300
      [c000000073f97e30] c00000000000a008 syscall_exit+0x0/0x7c
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      6f5405bc
    • T
      powerpc/pseries: dynamically added OF nodes need to call of_node_init · 97a9a717
      Tyrel Datwyler 提交于
      Commit 75b57ecf refactored device tree nodes to use kobjects such that they
      can be exposed via /sysfs. A secondary commit 0829f6d1 furthered this rework
      by moving the kobect initialization logic out of of_node_add into its own
      of_node_init function. The inital commit removed the existing kref_init calls
      in the pseries dlpar code with the assumption kobject initialization would
      occur in of_node_add. The second commit had the side effect of triggering a
      BUG_ON during DLPAR, migration and suspend/resume operations as a result of
      dynamically added nodes being uninitialized.
      
      This patch fixes this by adding of_node_init calls in place of the previously
      removed kref_init calls.
      
      Fixes: 0829f6d1 ("of: device_node kobject lifecycle fixes")
      Cc: stable@vger.kernel.org
      Signed-off-by: NTyrel Datwyler <tyreld@linux.vnet.ibm.com>
      Acked-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Acked-by: NGrant Likely <grant.likely@linaro.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      97a9a717
    • A
      powerpc: subpage_protect: Increase the array size to take care of 64TB · dad6f37c
      Aneesh Kumar K.V 提交于
      We now support TASK_SIZE of 16TB, hence the array should be 8.
      
      Fixes the below crash:
      
      Unable to handle kernel paging request for data at address 0x000100bd
      Faulting instruction address: 0xc00000000004f914
      cpu 0x13: Vector: 300 (Data Access) at [c000000fea75fa90]
          pc: c00000000004f914: .sys_subpage_prot+0x2d4/0x5c0
          lr: c00000000004fb5c: .sys_subpage_prot+0x51c/0x5c0
          sp: c000000fea75fd10
         msr: 9000000000009032
         dar: 100bd
       dsisr: 40000000
        current = 0xc000000fea6ae490
        paca    = 0xc00000000fb8ab00   softe: 0        irq_happened: 0x00
          pid   = 8237, comm = a.out
      enter ? for help
      [c000000fea75fe30] c00000000000a164 syscall_exit+0x0/0x98
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      dad6f37c
    • P
      powerpc: Fix bugs in emulate_step() · e698b966
      Paul Mackerras 提交于
      This fixes some bugs in emulate_step().  First, the setting of the carry
      bit for the arithmetic right-shift instructions was not correct on 64-bit
      machines because we were masking with a mask of type int rather than
      unsigned long.  Secondly, the sld (shift left doubleword) instruction was
      using the wrong instruction field for the register containing the shift
      count.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e698b966
    • J
      powerpc: Disable doorbells on Power8 DD1.x · bd6ba351
      Joel Stanley 提交于
      These processors do not currently support doorbell IPIs, so remove them
      from the feature list if we are at DD 1.xx for the 0x004d part.
      
      This fixes a regression caused by d4e58e59 (powerpc/powernv: Enable
      POWER8 doorbell IPIs). With that patch the kernel would hang at boot
      when calling smp_call_function_many, as the doorbell would not be
      received by the target CPUs:
      
        .smp_call_function_many+0x2bc/0x3c0 (unreliable)
        .on_each_cpu_mask+0x30/0x100
        .cpuidle_register_driver+0x158/0x1a0
        .cpuidle_register+0x2c/0x110
        .powernv_processor_idle_init+0x23c/0x2c0
        .do_one_initcall+0xd4/0x260
        .kernel_init_freeable+0x25c/0x33c
        .kernel_init+0x1c/0x120
        .ret_from_kernel_thread+0x58/0x7c
      
      Fixes: d4e58e59 (powerpc/powernv: Enable POWER8 doorbell IPIs)
      Signed-off-by: NJoel Stanley <joel@jms.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      bd6ba351
    • D
      sparc: Hook up renameat2 syscall. · 26053926
      David S. Miller 提交于
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      26053926
    • B
      x86, MCE: Robustify mcheck_init_device · 51cbe7e7
      Borislav Petkov 提交于
      BorisO reports that misc_register() fails often on xen. The current code
      unregisters the CPU hotplug notifier in that case. If then a CPU is
      offlined and onlined back again, we end up with a second timer running
      on that CPU, leading to soft lockups and system hangs.
      
      So let's leave the hotcpu notifier always registered - even if
      mce_device_create failed for some cores and never unreg it so that we
      can deal with the timer handling accordingly.
      Reported-and-Tested-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Link: http://lkml.kernel.org/r/1403274493-1371-1-git-send-email-boris.ostrovsky@oracle.comSigned-off-by: NBorislav Petkov <bp@suse.de>
      51cbe7e7
  7. 20 7月, 2014 4 次提交
  8. 19 7月, 2014 1 次提交
  9. 18 7月, 2014 3 次提交