1. 28 Sep, 2016 1 commit
  2. 13 Sep, 2016 2 commits
  3. 19 May, 2015 1 commit
  4. 08 Jan, 2015 2 commits
  5. 09 Sep, 2014 1 commit
    • Chen Gang's avatar
      arch/microblaze/include/asm/uaccess.h: Use pr_devel() instead of pr_debug() · de295cf0
      Chen Gang authored
      When DYNAMIC_DEBUG enabled, pr_debug() depends on KBUILD_MODNAME which
      also depends on the modules number in Makefile. The related information
      in "scripts/Makefile.lib" line 94:
        # $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will
        # end up in (or would, if it gets compiled in)
        # Note: Files that end up in two or more modules are compiled without the
        #       KBUILD_MODNAME definition. The reason is that any made-up name would
        #       differ in different configs.
      For this case, 'radio-si470x-i2c.o' and 'radio-si470x-common.o' are in
      one line, so cause compiling issue. And 'uaccess.h' is a common shared
      header (not specially for drivers), so use pr_devel() instead of is OK.
      The related error with allmodconfig:
          CC [M]  drivers/media/radio/si470x/radio-si470x-i2c.o
          CC [M]  drivers/media/radio/si470x/radio-si470x-common.o
        In file included from include/linux/printk.h:257:0,
                         from include/linux/kernel.h:13,
                         from drivers/media/radio/si470x/radio-si470x.h:29,
                         from drivers/media/radio/si470x/radio-si470x-common.c:115:
        ./arch/microblaze/include/asm/uaccess.h: In function 'access_ok':
        include/linux/dynamic_debug.h:66:14: error: 'KBUILD_MODNAME' undeclared (first use in this function)
           .modname = KBUILD_MODNAME,   \
        include/linux/dynamic_debug.h:76:2: note: in expansion of macro 'DEFINE_DYNAMIC_DEBUG_METADATA'
          DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);  \
        include/linux/printk.h:263:2: note: in expansion of macro 'dynamic_pr_debug'
          dynamic_pr_debug(fmt, ##__VA_ARGS__)
        ./arch/microblaze/include/asm/uaccess.h:101:3: note: in expansion of macro 'pr_debug'
           pr_debug("ACCESS fail: %s at 0x%08x (size 0x%x), seg 0x%08x\n",
      Signed-off-by: default avatarChen Gang <gang.chen.5i5j@gmail.com>
      Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
  6. 03 Jun, 2013 1 commit
  7. 28 May, 2013 1 commit
  8. 09 May, 2013 1 commit
    • Michal Simek's avatar
      microblaze: Fix uaccess_ok macro · f663b60f
      Michal Simek authored
      Fix access_ok macro no to permit
      case where user will try to access
      the last address space which is equal
      to segment address.
      segment addr = 0xbfff ffff
      address = 0xbfff fff0
      size = 0x10
      Current wrong implementation
      0xbfff ffff >= (0xbfff fff0 | 0x10 | (0xbfff fff0 + 0x10))
      0xbfff ffff >= (0xbfff fff0        | 0xc000 0000)
      0xbfff ffff >= 0xf000 0000
      return 0 which is access failed even the combination is valid.
      because get_fs().seq returns the last valid address.
      This patch fix this problem.
      Size equals to zero is valid access.
      Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
  9. 03 Jan, 2013 1 commit
    • Michal Simek's avatar
      microblaze: Change section flags for noMMU · 7e278157
      Michal Simek authored
      All files which uses user unified macros from uaccess.h
      strnlen_user and strncpy_user) generate this
      warning messages:
      Assembler messages:
      Warning: ignoring changed section attributes for .discard
      Setting up discard executable section flang for __EX_TABLE_SECTION
      macro removed all these warnings.
      Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
  10. 13 Dec, 2012 1 commit
    • Michal Simek's avatar
      microblaze: uaccess.h: Fix timerfd syscall · bf0e12c7
      Michal Simek authored
      __pu_val must be volatile to ensure that the value is not lost.
      It was causing the problem with timerfd syscall
      where using inline asm at the end of function call doesn't
      save u64 bit value to the stack.
      In comparison both cases you can find out this fragment
      where you can see the first part which is saved u64
      value to stack and then using it in __put_user_asm_8 macro.
      Origin broken implementation misses the first two swi instructions.
      	swi	r22, r1, 28 /* missing without volatile */
      	swi	r23, r1, 32
      	addik	r4, r1, 28
      	lwi	r3, r4, 0
      	swi	r3, r25, 0
      	lwi	r3, r4, 4
      	swi	r3, r25, 4
      	addk	r3, r0, r0
      NOTE: Moving __put_val initialization after declaration
      has not impact on this bug. It is just coding style issue.
      Signed-off-by: Michal Simek's avatarMichal Simek <monstr@monstr.eu>
  11. 23 Mar, 2012 1 commit
  12. 14 Oct, 2011 1 commit
  13. 09 Mar, 2011 1 commit
    • Steven J. Magnani's avatar
      microblaze: Fix /dev/zero corruption from __clear_user() · 6f3946b4
      Steven J. Magnani authored and Michal Simek's avatar Michal Simek committed
      A userland read of more than PAGE_SIZE bytes from /dev/zero results in
      (a) not all of the bytes returned being zero, and
      (b) memory corruption due to zeroing of bytes beyond the user buffer.
      This is caused by improper constraints on the assembly __clear_user function.
      The constrints don't indicate to the compiler that the pointer argument is
      modified. Since the function is inline, this results in double-incrementing
      of the pointer when __clear_user() is invoked through a multi-page read() of
      Signed-off-by: default avatarSteven J. Magnani <steve@digidescorp.com>
      Acked-by: Michal Simek's avatarMichal Simek <monstr@monstr.eu>
      CC: stable@kernel.org
  14. 02 Aug, 2010 1 commit
    • Michal Simek's avatar
      microblaze: Fix __copy_to/from_user_inatomic macros · 8d7ec6ee
      Michal Simek authored
      __copy_to/from_user_inatomic should call __copy_to/from_user
      because there is not necessary to check access because of kernel function.
      might_sleep in copy_to/from_user macros is causing problems
      in debug sessions too (CONFIG_DEBUG_SPINLOCK_SLEEP).
      BUG: sleeping function called from invalid context at
      in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: swapper
      1 lock held by swapper/1:
       #0:  (&p->cred_guard_mutex){......}, at: [<c00d4b90>] prepare_bprm_creds+0x2c/0x88
      Kernel Stack:
      Call Trace:
      [<c0006bd4>] microblaze_unwind+0x7c/0x94
      [<c0006684>] show_stack+0xf4/0x190
      [<c0006730>] dump_stack+0x10/0x30
      [<c00103a0>] __might_sleep+0x12c/0x160
      [<c0090de4>] file_read_actor+0x1d8/0x2a8
      [<c0091568>] generic_file_aio_read+0x6b4/0xa64
      [<c00cd778>] do_sync_read+0xac/0x110
      [<c00ce254>] vfs_read+0xc8/0x160
      [<c00d585c>] kernel_read+0x38/0x64
      [<c00d5984>] prepare_binprm+0xfc/0x130
      [<c00d6430>] do_execve+0x228/0x370
      [<c000614c>] microblaze_execve+0x58/0xa4
      caused by file_read_actor (mm/filemap.c) which calls
      Signed-off-by: Michal Simek's avatarMichal Simek <monstr@monstr.eu>
  15. 13 May, 2010 1 commit
    • Steven J. Magnani's avatar
      microblaze: fix get_user/put_user side-effects · 538722ca
      Steven J. Magnani authored and Michal Simek's avatar Michal Simek committed
      The Microblaze implementations of get_user() and (MMU) put_user() evaluate
      the address argument more than once. This causes unexpected side-effects for
      invocations that include increment operators, i.e. get_user(foo, bar++).
      This patch also removes the distinction between MMU and noMMU put_user().
      Without the patch:
        $ echo 1234567890 > /proc/sys/kernel/core_pattern
        $ cat /proc/sys/kernel/core_pattern
      Signed-off-by: default avatarSteven J. Magnani <steve@digidescorp.com>
  16. 01 Apr, 2010 16 commits
  17. 14 Dec, 2009 1 commit
  18. 27 Jul, 2009 1 commit
    • Michal Simek's avatar
      microblaze: Fix put_user macro for 64bits arguments · 7bcb63b2
      Michal Simek authored
      For 64bits arguments gcc caused that put_user macro
      works with wrong value because of optimalization.
      Adding volatile caused that gcc not optimized it.
      It is possible to use (as Blackfin do) two put_user
      macros with 32bits arguments but there is one more
      instruction which is due to duplication zero return
      value which is called put_user_asm macro.
      Signed-off-by: Michal Simek's avatarMichal Simek <monstr@monstr.eu>
  19. 26 May, 2009 1 commit
  20. 21 May, 2009 1 commit
  21. 27 Mar, 2009 1 commit