]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
sparc: Fix syscall fallback bugs in VDSO.
authorDavid S. Miller <davem@davemloft.net>
Thu, 18 Oct 2018 04:28:01 +0000 (21:28 -0700)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:55:47 +0000 (19:55 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836654
[ Upstream commit 776ca1543b5fe673aaf1beb244fcc2429d378083 ]

First, the trap number for 32-bit syscalls is 0x10.

Also, only negate the return value when syscall error is indicated by
the carry bit being set.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/sparc/vdso/vclock_gettime.c

index 3feb3d960ca50c6152c8b702eadb50d9e0b5a42f..75dca9aab737c6cb43cda34d098a7ad005d552e8 100644 (file)
 #define        TICK_PRIV_BIT   (1ULL << 63)
 #endif
 
+#ifdef CONFIG_SPARC64
 #define SYSCALL_STRING                                                 \
        "ta     0x6d;"                                                  \
-       "sub    %%g0, %%o0, %%o0;"                                      \
+       "bcs,a  1f;"                                                    \
+       " sub   %%g0, %%o0, %%o0;"                                      \
+       "1:"
+#else
+#define SYSCALL_STRING                                                 \
+       "ta     0x10;"                                                  \
+       "bcs,a  1f;"                                                    \
+       " sub   %%g0, %%o0, %%o0;"                                      \
+       "1:"
+#endif
 
 #define SYSCALL_CLOBBERS                                               \
        "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",                 \