1. 01 Sep, 2021 4 commits
    • Helge Deller's avatar
      parisc: math-emu: Fix fall-through warnings · 6f1fce59
      Helge Deller authored
      Fix lots of fallthrough warnings, e.g.:
      arch/parisc/math-emu/fpudispatch.c:323:33: warning: this statement may fall through [-Wimplicit-fallthrough=]
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      6f1fce59
    • Mikulas Patocka's avatar
      parisc: fix crash with signals and alloca · 030f6530
      Mikulas Patocka authored
      I was debugging some crashes on parisc and I found out that there is a
      crash possibility if a function using alloca is interrupted by a signal.
      The reason for the crash is that the gcc alloca implementation leaves
      garbage in the upper 32 bits of the sp register. This normally doesn't
      matter (the upper bits are ignored because the PSW W-bit is clear),
      however the signal delivery routine in the kernel uses full 64 bits of sp
      and it fails with -EFAULT if the upper 32 bits are not zero.
      
      I created this program that demonstrates the problem:
      
      #include <stdlib.h>
      #include <unistd.h>
      #include <signal.h>
      #include <alloca.h>
      
      static __attribute__((noinline,noclone)) void aa(int *size)
      {
      	void * volatile p = alloca(-*size);
      	while (1) ;
      }
      
      static void handler(int sig)
      {
      	write(1, "signal delivered\n", 17);
      	_exit(0);
      }
      
      int main(void)
      {
      	int size = -0x100;
      	signal(SIGALRM, handler);
      	alarm(1);
      	aa(&size);
      }
      
      If you compile it with optimizations, it will crash.
      The "aa" function has this disassembly:
      
      000106a0 <aa>:
         106a0:       08 03 02 41     copy r3,r1
         106a4:       08 1e 02 43     copy sp,r3
         106a8:       6f c1 00 80     stw,ma r1,40(sp)
         106ac:       37 dc 3f c1     ldo -20(sp),ret0
         106b0:       0c 7c 12 90     stw ret0,8(r3)
         106b4:       0f 40 10 9c     ldw 0(r26),ret0		; ret0 = 0x00000000FFFFFF00
         106b8:       97 9c 00 7e     subi 3f,ret0,ret0	; ret0 = 0xFFFFFFFF0000013F
         106bc:       d7 80 1c 1a     depwi 0,31,6,ret0	; ret0 = 0xFFFFFFFF00000100
         106c0:       0b 9e 0a 1e     add,l sp,ret0,sp	;   sp = 0xFFFFFFFFxxxxxxxx
         106c4:       e8 1f 1f f7     b,l,n 106c4 <aa+0x24>,r0
      
      This patch fixes the bug by truncating the "usp" variable to 32 bits.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      030f6530
    • Masahiro Yamada's avatar
      parisc: Fix compile failure when building 64-bit kernel natively · 5f6e0fe0
      Masahiro Yamada authored
      Commit 23243c1a ("arch: use cross_compiling to check whether it is
      a cross build or not") broke 64-bit parisc builds on 32-bit parisc
      systems.
      
      Helge mentioned:
        - 64-bit parisc userspace is not supported yet [1]
        - hppa gcc does not support "-m64" flag [2]
      
      That means, parisc developers working on a 32-bit parisc machine need
      to use hppa64-linux-gnu-gcc (cross compiler) for building the 64-bit
      parisc kernel.
      
      After the offending commit, gcc is used in such a case because
      both $(SRCARCH) and $(SUBARCH) are 'parisc', hence cross_compiling is
      unset.
      
      A correct way is to introduce ARCH=parisc64 because building the 64-bit
      parisc kernel on a 32-bit parisc system is not exactly a native build,
      but rather a semi-cross build.
      
      [1]: https://lore.kernel.org/linux-parisc/5dfd81eb-c8ca-b7f5-e80e-8632767c022d@gmx.de/#t
      [2]: https://lore.kernel.org/linux-parisc/89515325-fc21-31da-d238-6f7a9abbf9a0@gmx.de/
      
      Fixes: 23243c1a ("arch: use cross_compiling to check whether it is a cross build or not")
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Reported-by: default avatarMeelis Roos <mroos@linux.ee>
      Tested-by: default avatarMeelis Roos <mroos@linux.ee>
      Cc: <stable@vger.kernel.org> # v5.13+
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      5f6e0fe0
    • Shubhankar Kuranagatti's avatar
      parisc: ccio-dma.c: Added tab instead of spaces · 8ef5b28d
      Shubhankar Kuranagatti authored
      Single spaces has been removed and replaced with tabs.
      This is done to maintain code uniformity.
      Signed-off-by: default avatarShubhankar Kuranagatti <shubhankarvk@gmail.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      8ef5b28d
  2. 30 Aug, 2021 9 commits
  3. 29 Aug, 2021 8 commits
  4. 28 Aug, 2021 3 commits
  5. 27 Aug, 2021 16 commits