Skip to content
  1. May 15, 2021
    • Peter Zijlstra's avatar
      openrisc: Define memory barrier mb · 8b549c18
      Peter Zijlstra authored
      
      
      This came up in the discussion of the requirements of qspinlock on an
      architecture.  OpenRISC uses qspinlock, but it was noticed that the
      memmory barrier was not defined.
      
      Peter defined it in the mail thread writing:
      
          As near as I can tell this should do. The arch spec only lists
          this one instruction and the text makes it sound like a completion
          barrier.
      
      This is correct so applying this patch.
      
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      [shorne@gmail.com:Turned the mail into a patch]
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      8b549c18
  2. May 09, 2021
  3. May 07, 2021
    • David Hildenbrand's avatar
      drivers/char: remove /dev/kmem for good · bbcd53c9
      David Hildenbrand authored
      Patch series "drivers/char: remove /dev/kmem for good".
      
      Exploring /dev/kmem and /dev/mem in the context of memory hot(un)plug and
      memory ballooning, I started questioning the existence of /dev/kmem.
      
      Comparing it with the /proc/kcore implementation, it does not seem to be
      able to deal with things like
      
      a) Pages unmapped from the direct mapping (e.g., to be used by secretmem)
        -> kern_addr_valid(). virt_addr_valid() is not sufficient.
      
      b) Special cases like gart aperture memory that is not to be touched
        -> mem_pfn_is_ram()
      
      Unless I am missing something, it's at least broken in some cases and might
      fault/crash the machine.
      
      Looks like its existence has been questioned before in 2005 and 2010 [1],
      after ~11 additional years, it might make sense to revive the discussion.
      
      CONFIG_DEVKMEM is only enabled in a single defconfig (on purpose or by
      mistake?).  All distributions disable it: in Ubuntu it has been disabled
      for more than 10 years, in Debian since 2.6.31, in Fedora at least
      starting with FC3, in RHEL starting with RHEL4, in SUSE starting from
      15sp2, and OpenSUSE has it disabled as well.
      
      1) /dev/kmem was popular for rootkits [2] before it got disabled
         basically everywhere. Ubuntu documents [3] "There is no modern user of
         /dev/kmem any more beyond attackers using it to load kernel rootkits.".
         RHEL documents in a BZ [5] "it served no practical purpose other than to
         serve as a potential security problem or to enable binary module drivers
         to access structures/functions they shouldn't be touching"
      
      2) /proc/kcore is a decent interface to have a controlled way to read
         kernel memory for debugging puposes. (will need some extensions to
         deal with memory offlining/unplug, memory ballooning, and poisoned
         pages, though)
      
      3) It might be useful for corner case debugging [1]. KDB/KGDB might be a
         better fit, especially, to write random memory; harder to shoot
         yourself into the foot.
      
      4) "Kernel Memory Editor" [4] hasn't seen any updates since 2000 and seems
         to be incompatible with 64bit [1]. For educational purposes,
         /proc/kcore might be used to monitor value updates -- or older
         kernels can be used.
      
      5) It's broken on arm64, and therefore, completely disabled there.
      
      Looks like it's essentially unused and has been replaced by better
      suited interfaces for individual tasks (/proc/kcore, KDB/KGDB). Let's
      just remove it.
      
      [1] https://lwn.net/Articles/147901/
      [2] https://www.linuxjournal.com/article/10505
      [3] https://wiki.ubuntu.com/Security/Features#A.2Fdev.2Fkmem_disabled
      [4] https://sourceforge.net/projects/kme/
      [5] https://bugzilla.redhat.com/show_bug.cgi?id=154796
      
      Link: https://lkml.kernel.org/r/20210324102351.6932-1-david@redhat.com
      Link: https://lkml.kernel.org/r/20210324102351.6932-2-david@redhat.com
      
      
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "Alexander A. Klimov" <grandmaster@al2klimov.de>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: Corentin Labbe <clabbe@baylibre.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Gregory Clement <gregory.clement@bootlin.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Hillf Danton <hdanton@sina.com>
      Cc: huang ying <huang.ying.caritas@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: James Troup <james.troup@canonical.com>
      Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Kairui Song <kasong@redhat.com>
      Cc: Krzysztof Kozlowski <krzk@kernel.org>
      Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Cc: Liviu Dudau <liviu.dudau@arm.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Mike Rapoport <rppt@kernel.org>
      Cc: Mikulas Patocka <mpatocka@redhat.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Niklas Schnelle <schnelle@linux.ibm.com>
      Cc: Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>
      Cc: openrisc@lists.librecores.org
      Cc: Palmer Dabbelt <palmerdabbelt@google.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: "Pavel Machek (CIP)" <pavel@denx.de>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
      Cc: Pierre Morel <pmorel@linux.ibm.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Cc: sparclinux@vger.kernel.org
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Theodore Dubois <tblodt@icloud.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Xiaoming Ni <nixiaoming@huawei.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bbcd53c9
  4. Apr 30, 2021
  5. Apr 28, 2021
  6. Feb 22, 2021
  7. Feb 08, 2021
  8. Jan 19, 2021
  9. Jan 18, 2021
  10. Jan 01, 2021
  11. Dec 29, 2020
  12. Nov 24, 2020
  13. Nov 20, 2020
    • Stafford Horne's avatar
      openrisc: add local64.h to fix blk-iocost build · d8398bf8
      Stafford Horne authored
      
      
      As of 5.10 OpenRISC allyesconfig builds fail with the following error.
      
          $ make ARCH=openrisc CROSS_COMPILE=or1k-elf- block/blk-iocost.o
            CALL    scripts/checksyscalls.sh
            CALL    scripts/atomic/check-atomics.sh
            CC      block/blk-iocost.o
          block/blk-iocost.c:183:10: fatal error: asm/local64.h: No such file or directory
            183 | #include <asm/local64.h>
      	  |          ^~~~~~~~~~~~~~~
          compilation terminated.
      
      The new include of local64.h was added in commit 5e124f74
      ("blk-iocost: use local[64]_t for percpu stat") by Tejun.
      
      Adding the generic version of local64.h to OpenRISC fixes the build
      issue.
      
      Cc: Tejun Heo <tj@kernel.org>
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      d8398bf8
  14. Nov 11, 2020
  15. Nov 09, 2020
  16. Nov 06, 2020
  17. Oct 30, 2020
    • Arnd Bergmann's avatar
      timekeeping: default GENERIC_CLOCKEVENTS to enabled · 0774a6ed
      Arnd Bergmann authored
      
      
      Almost all machines use GENERIC_CLOCKEVENTS, so it feels wrong to
      require each one to select that symbol manually.
      
      Instead, enable it whenever CONFIG_LEGACY_TIMER_TICK is disabled as
      a simplification. It should be possible to select both
      GENERIC_CLOCKEVENTS and LEGACY_TIMER_TICK from an architecture now
      and decide at runtime between the two.
      
      For the clockevents arch-support.txt file, this means that additional
      architectures are marked as TODO when they have at least one machine
      that still uses LEGACY_TIMER_TICK, rather than being marked 'ok' when
      at least one machine has been converted. This means that both m68k and
      arm (for riscpc) revert to TODO.
      
      At this point, we could just always enable CONFIG_GENERIC_CLOCKEVENTS
      rather than leaving it off when not needed. I built an m68k
      defconfig kernel (using gcc-10.1.0) and found that this would add
      around 5.5KB in kernel image size:
      
         text	   data	    bss	    dec	    hex	filename
      3861936	1092236	 196656	5150828	 4e986c	obj-m68k/vmlinux-no-clockevent
      3866201	1093832	 196184	5156217	 4ead79	obj-m68k/vmlinux-clockevent
      
      On Arm (MACH_RPC), that difference appears to be twice as large,
      around 11KB on top of an 6MB vmlinux.
      
      Reviewed-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Tested-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      0774a6ed
  18. Oct 27, 2020
  19. Oct 17, 2020
  20. Oct 14, 2020
    • Mike Rapoport's avatar
      arch, drivers: replace for_each_membock() with for_each_mem_range() · b10d6bca
      Mike Rapoport authored
      There are several occurrences of the following pattern:
      
      	for_each_memblock(memory, reg) {
      		start = __pfn_to_phys(memblock_region_memory_base_pfn(reg);
      		end = __pfn_to_phys(memblock_region_memory_end_pfn(reg));
      
      		/* do something with start and end */
      	}
      
      Using for_each_mem_range() iterator is more appropriate in such cases and
      allows simpler and cleaner code.
      
      [akpm@linux-foundation.org: fix arch/arm/mm/pmsa-v7.c build]
      [rppt@linux.ibm.com: mips: fix cavium-octeon build caused by memblock refactoring]
        Link: http://lkml.kernel.org/r/20200827124549.GD167163@linux.ibm.com
      
      
      
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Daniel Axtens <dja@axtens.net>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Emil Renner Berthing <kernel@esmil.dk>
      Cc: Hari Bathini <hbathini@linux.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
      Cc: Marek Szyprowski <m.szyprowski@samsung.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: https://lkml.kernel.org/r/20200818151634.14343-13-rppt@kernel.org
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b10d6bca
    • Mike Rapoport's avatar
      h8300, nds32, openrisc: simplify detection of memory extents · 80c45744
      Mike Rapoport authored
      
      
      Instead of traversing memblock.memory regions to find memory_start and
      memory_end, simply query memblock_{start,end}_of_DRAM().
      
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarStafford Horne <shorne@gmail.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Daniel Axtens <dja@axtens.net>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Emil Renner Berthing <kernel@esmil.dk>
      Cc: Hari Bathini <hbathini@linux.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
      Cc: Marek Szyprowski <m.szyprowski@samsung.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: https://lkml.kernel.org/r/20200818151634.14343-6-rppt@kernel.org
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      80c45744
  21. Oct 06, 2020
  22. Sep 12, 2020
    • Stafford Horne's avatar
      openrisc: Fix issue with get_user for 64-bit values · d877322b
      Stafford Horne authored
      A build failure was raised by kbuild with the following error.
      
          drivers/android/binder.c: Assembler messages:
          drivers/android/binder.c:3861: Error: unrecognized keyword/register name `l.lwz ?ap,4(r24)'
          drivers/android/binder.c:3866: Error: unrecognized keyword/register name `l.addi ?ap,r0,0'
      
      The issue is with 64-bit get_user() calls on openrisc.  I traced this to
      a problem where in the internally in the get_user macros there is a cast
      to long __gu_val this causes GCC to think the get_user call is 32-bit.
      This binder code is really long and GCC allocates register r30, which
      triggers the issue. The 64-bit get_user asm tries to get the 64-bit pair
      register, which for r30 overflows the general register names and returns
      the dummy register ?ap.
      
      The fix here is to move the temporary variables into the asm macros.  We
      use a 32-bit __gu_tmp for 32-bit and smaller macro and a 64-bit tmp in
      the 64-bit macro.  The cast in the 64-bit macro has a trick of casting
      through __typeof__((x)-(x)) which avoids the below warning.  This was
      barrowed from riscv.
      
          arch/openrisc/include/asm/uaccess.h:240:8: warning: cast to pointer from integer of different size
      
      I tested this in a small unit test to check reading between 64-bit and
      32-bit pointers to 64-bit and 32-bit values in all combinations.  Also I
      ran make C=1 to confirm no new sparse warnings came up.  It all looks
      clean to me.
      
      Link: https://lore.kernel.org/lkml/202008200453.ohnhqkjQ%25lkp@intel.com/
      
      
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      Reviewed-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      d877322b
  23. Sep 09, 2020
  24. Sep 07, 2020
    • Stafford Horne's avatar
      openrisc: Fix cache API compile issue when not inlining · 3ae90d76
      Stafford Horne authored
      I found this when compiling a kbuild random config with GCC 11.  The
      config enables CONFIG_DEBUG_SECTION_MISMATCH, which sets CFLAGS
      -fno-inline-functions-called-once. This causes the call to cache_loop in
      cache.c to not be inlined causing the below compile error.
      
          In file included from arch/openrisc/mm/cache.c:13:
          arch/openrisc/mm/cache.c: In function 'cache_loop':
          ./arch/openrisc/include/asm/spr.h:16:27: warning: 'asm' operand 0 probably does not match constraints
             16 | #define mtspr(_spr, _val) __asm__ __volatile__ (  \
      	  |                           ^~~~~~~
          arch/openrisc/mm/cache.c:25:3: note: in expansion of macro 'mtspr'
             25 |   mtspr(reg, line);
      	  |   ^~~~~
          ./arch/openrisc/include/asm/spr.h:16:27: error: impossible constraint in 'asm'
             16 | #define mtspr(_spr, _val) __asm__ __volatile__ (  \
      	  |                           ^~~~~~~
          arch/openrisc/mm/cache.c:25:3: note: in expansion of macro 'mtspr'
             25 |   mtspr(reg, line);
      	  |   ^~~~~
          make[1]: *** [scripts/Makefile.build:283: arch/openrisc/mm/cache.o] Error 1
      
      The asm constraint "K" requires a immediate constant argument to mtspr,
      however because of no inlining a register argument is passed causing a
      failure.  Fix this by using __always_inline.
      
      Link: https://lore.kernel.org/lkml/202008200453.ohnhqkjQ%25lkp@intel.com/
      
      
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      3ae90d76
    • Stafford Horne's avatar
      openrisc: Reserve memblock for initrd · 141d1704
      Stafford Horne authored
      
      
      Recently OpenRISC added support for external initrd images, but I found
      some instability when using larger buildroot initrd images. It turned
      out that I forgot to reserve the memblock space for the initrd image.
      
      This patch fixes the instability issue by reserving memblock space.
      
      Fixes: ff6c923d ("openrisc: Add support for external initrd images")
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      Reviewed-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      141d1704
  25. Sep 01, 2020
  26. Aug 23, 2020
  27. Aug 12, 2020
  28. Aug 08, 2020
    • Stafford Horne's avatar
      openrisc: uaccess: Add user address space check to access_ok · 55b2662e
      Stafford Horne authored
      
      
      Now that __user annotations are fixed for openrisc uaccess api's we can
      add checking to the access_ok macro.  This patch adds the __chk_user_ptr
      check, on normal builds the added check is a nop.
      
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      Reviewed-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      55b2662e
    • Stafford Horne's avatar
      openrisc: signal: Fix sparse address space warnings · d9959664
      Stafford Horne authored
      
      
      The __user annotations in signal.c were mostly missing.  The missing
      annotations caused the warnings listed below.  This patch fixes them up
      by adding the __user annotations.
      
      arch/openrisc/kernel/signal.c:71:38: warning: incorrect type in initializer (different address spaces)
      arch/openrisc/kernel/signal.c:71:38:    expected struct rt_sigframe *frame
      arch/openrisc/kernel/signal.c:71:38:    got struct rt_sigframe [noderef] __user *
      arch/openrisc/kernel/signal.c:82:14: warning: incorrect type in argument 1 (different address spaces)
      arch/openrisc/kernel/signal.c:82:14:    expected void const volatile [noderef] __user *
      arch/openrisc/kernel/signal.c:82:14:    got struct rt_sigframe *frame
      arch/openrisc/kernel/signal.c:84:37: warning: incorrect type in argument 2 (different address spaces)
      arch/openrisc/kernel/signal.c:84:37:    expected void const [noderef] __user *from
      arch/openrisc/kernel/signal.c:84:37:    got struct sigset_t *
      arch/openrisc/kernel/signal.c:89:39: warning: incorrect type in argument 2 (different address spaces)
      arch/openrisc/kernel/signal.c:89:39:    expected struct sigcontext [noderef] __user *sc
      arch/openrisc/kernel/signal.c:89:39:    got struct sigcontext *
      arch/openrisc/kernel/signal.c:92:31: warning: incorrect type in argument 1 (different address spaces)
      arch/openrisc/kernel/signal.c:92:31:    expected struct sigaltstack const [noderef] [usertype] __user *
      arch/openrisc/kernel/signal.c:92:31:    got struct sigaltstack *
      arch/openrisc/kernel/signal.c:158:15: warning: incorrect type in assignment (different address spaces)
      arch/openrisc/kernel/signal.c:158:15:    expected struct rt_sigframe *frame
      arch/openrisc/kernel/signal.c:158:15:    got void [noderef] __user *
      arch/openrisc/kernel/signal.c:160:14: warning: incorrect type in argument 1 (different address spaces)
      arch/openrisc/kernel/signal.c:160:14:    expected void const volatile [noderef] __user *
      arch/openrisc/kernel/signal.c:160:14:    got struct rt_sigframe *frame
      arch/openrisc/kernel/signal.c:165:46: warning: incorrect type in argument 1 (different address spaces)
      arch/openrisc/kernel/signal.c:165:46:    expected struct siginfo [noderef] [usertype] __user *to
      arch/openrisc/kernel/signal.c:165:46:    got struct siginfo *
      arch/openrisc/kernel/signal.c:170:33: warning: incorrect type in argument 1 (different address spaces)
      arch/openrisc/kernel/signal.c:170:33:    expected struct sigaltstack [noderef] [usertype] __user *
      arch/openrisc/kernel/signal.c:170:33:    got struct sigaltstack *
      arch/openrisc/kernel/signal.c:171:40: warning: incorrect type in argument 2 (different address spaces)
      arch/openrisc/kernel/signal.c:171:40:    expected struct sigcontext [noderef] __user *sc
      arch/openrisc/kernel/signal.c:171:40:    got struct sigcontext *
      arch/openrisc/kernel/signal.c:173:32: warning: incorrect type in argument 1 (different address spaces)
      arch/openrisc/kernel/signal.c:173:32:    expected void [noderef] __user *to
      arch/openrisc/kernel/signal.c:173:32:    got struct sigset_t *
      
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      Reviewed-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      d9959664
    • Stafford Horne's avatar
      openrisc: uaccess: Remove unused macro __addr_ok · aac9a9b5
      Stafford Horne authored
      
      
      Since commit b48b2c3e ("openrisc: use generic strnlen_user()
      function") the macro __addr_ok is no longer used.  It is safe to remove
      so this patch removes it.
      
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      aac9a9b5
    • Stafford Horne's avatar
      openrisc: uaccess: Use static inline function in access_ok · af84b16e
      Stafford Horne authored
      
      
      As suggested by Linus when reviewing commit 9cb2feb4
      ("arch/openrisc: Fix issues with access_ok()") last year; making
      __range_ok an inline function also fixes the used twice issue that the
      commit was fixing.  I agree it's a good cleanup.  This patch addresses
      that as I am currently working on the access_ok macro to fixup sparse
      annotations in OpenRISC.
      
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      Reviewed-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      af84b16e
    • Stafford Horne's avatar
      openrisc: uaccess: Fix sparse address space warnings · 17fcd83c
      Stafford Horne authored
      
      
      The OpenRISC user access functions put_user(), get_user() and
      clear_user() were missing proper sparse annotations.  This generated
      warnings like the below.
      
      This patch adds the annotations to fix the warnings.
      
      Example warnings:
      
      net/ipv4/ip_sockglue.c:759:29: warning: incorrect type in argument 1 (different address spaces)
      net/ipv4/ip_sockglue.c:759:29:    expected void const volatile [noderef] __user *
      net/ipv4/ip_sockglue.c:759:29:    got int const *__gu_addr
      net/ipv4/ip_sockglue.c:764:29: warning: incorrect type in initializer (different address spaces)
      net/ipv4/ip_sockglue.c:764:29:    expected unsigned char const *__gu_addr
      net/ipv4/ip_sockglue.c:764:29:    got unsigned char [noderef] __user *
      
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      Reviewed-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      17fcd83c
  29. Aug 07, 2020
Loading