lkml.org 
[lkml]   [2017]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: [PATCH 2/9] compat: Make compat helpers independent of CONFIG_COMPAT
On Fri, Nov 10, 2017 at 11:42 PM, Deepa Dinamani <deepa.kernel@gmail.com> 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 <deepa.kernel@gmail.com>

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.

Arnd

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

-#ifdef CONFIG_COMPAT
-
#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>
+#endif
#include <asm/siginfo.h>
#include <asm/signal.h>

-#endif
-
#ifndef COMPAT_USE_64BIT_TIME
#define COMPAT_USE_64BIT_TIME 0
#endif
@@ -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

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