[lkml]   [2017]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH 2/9] compat: Make compat helpers independent of CONFIG_COMPAT
On Fri, Nov 10, 2017 at 11:42 PM, Deepa Dinamani <> wrote:
> Many of the compat time syscalls are also repurposed as 32 bit
> native syscalls to provide backward compatibility while adding
> new y2038 safe sycalls.
> Enabling the helpers makes this possible.
> Signed-off-by: Deepa Dinamani <>

I ran into a build error on ARM64 with CONFIG_COMPAT=n with this patch,
here is a fixup that makes it build cleanly and should also work on other
architectures. Unfortunately, including asm/compat.h has a number of
dependencies on other headers, so I decided to just include them all
for the fixup.

Alternatively, we could change the architecture code to always include
asm/compat.h when using is_compat_thread(), or to replace
is_compat_thread() calls with in_compat_syscall(), but the approach
below should be more likely to work on the 64-bit architectures that I did
not try.


--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -9,8 +9,6 @@
#include <linux/types.h>
#include <linux/compat_time.h>

#include <linux/stat.h>
#include <linux/param.h> /* for HZ */
#include <linux/sem.h>
@@ -20,12 +18,12 @@
#include <linux/aio_abi.h> /* for aio_context_t */
#include <linux/unistd.h>

+#ifdef CONFIG_64BIT
#include <asm/compat.h>
#include <asm/siginfo.h>
#include <asm/signal.h>

@@ -774,7 +772,9 @@ static inline struct compat_timeval
ns_to_compat_timeval(s64 nsec)
#else /* !CONFIG_COMPAT */

#define is_compat_task() (0)
+#ifndef in_compat_syscall
static inline bool in_compat_syscall(void) { return false; }

#endif /* CONFIG_COMPAT */
 \ /
  Last update: 2017-11-14 17:48    [W:0.131 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site