* [PATCH] sparc: compat: allow including asm/compat.h for 32-bit
@ 2018-04-11 15:07 Arnd Bergmann
2018-04-11 19:32 ` Eric W. Biederman
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2018-04-11 15:07 UTC (permalink / raw)
To: David S. Miller, Thomas Gleixner, Deepa Dinamani
Cc: y2038, Arnd Bergmann, Eric W. Biederman, sparclinux, linux-kernel
We have several files on sparc that include linux/compat.h and expect
asm/compat.h not to be included, otherwise we get a build failure.
Since we need to include asm/compat.h for compat time_t handling
on all 32-bit architectures now, this hides some portions of
asm/compat.h in order to let the rest of the file get included.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/sparc/include/asm/compat.h | 4 ++++
1 file changed, 4 insertions(+)
This is the fix for the y2038 syscall series that missed the 4.17 merge
window. I've now spent two more days doing extra build testing on all
64-bit archtectures building with and without CONFIG_COMPAT, as well
as without CONFIG_64BIT. I did not run into any additional build failures
after this patch, so my plan is to pick that up into my y2038 tree after
-rc1 and send Thomas a pull request a few days later for inclusion
in linux-4.18.
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
index 161aeacbc9ad..4eb51d2dae98 100644
--- a/arch/sparc/include/asm/compat.h
+++ b/arch/sparc/include/asm/compat.h
@@ -157,6 +157,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
return (u32)(unsigned long)uptr;
}
+#ifdef CONFIG_COMPAT
static inline void __user *arch_compat_alloc_user_space(long len)
{
struct pt_regs *regs = current_thread_info()->kregs;
@@ -173,6 +174,7 @@ static inline void __user *arch_compat_alloc_user_space(long len)
return (void __user *) usp;
}
+#endif
struct compat_ipc64_perm {
compat_key_t key;
@@ -232,6 +234,7 @@ struct compat_shmid64_ds {
unsigned int __unused2;
};
+#ifdef CONFIG_COMPAT
static inline int is_compat_task(void)
{
return test_thread_flag(TIF_32BIT);
@@ -243,5 +246,6 @@ static inline bool in_compat_syscall(void)
return pt_regs_trap_type(current_pt_regs()) == 0x110;
}
#define in_compat_syscall in_compat_syscall
+#endif
#endif /* _ASM_SPARC64_COMPAT_H */
--
2.9.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] sparc: compat: allow including asm/compat.h for 32-bit
2018-04-11 15:07 [PATCH] sparc: compat: allow including asm/compat.h for 32-bit Arnd Bergmann
@ 2018-04-11 19:32 ` Eric W. Biederman
2018-04-11 20:25 ` Arnd Bergmann
0 siblings, 1 reply; 3+ messages in thread
From: Eric W. Biederman @ 2018-04-11 19:32 UTC (permalink / raw)
To: Arnd Bergmann
Cc: David S. Miller, Thomas Gleixner, Deepa Dinamani, y2038,
sparclinux, linux-kernel
Arnd Bergmann <arnd@arndb.de> writes:
> We have several files on sparc that include linux/compat.h and expect
> asm/compat.h not to be included, otherwise we get a build failure.
Should this say: "We have several files on sparc that include
linux/compat.h and expect asm/compat.h not be included when
!CONFIG_COMPAT." ?
I don't have your tree and I see asm/compat.h included from
linux/compat.h already so the description above seems wrong.
Eric
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sparc: compat: allow including asm/compat.h for 32-bit
2018-04-11 19:32 ` Eric W. Biederman
@ 2018-04-11 20:25 ` Arnd Bergmann
0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-04-11 20:25 UTC (permalink / raw)
To: Eric W. Biederman
Cc: David S. Miller, Thomas Gleixner, Deepa Dinamani,
y2038 Mailman List, sparclinux, Linux Kernel Mailing List
On Wed, Apr 11, 2018 at 9:32 PM, Eric W. Biederman
<ebiederm@xmission.com> wrote:
> Arnd Bergmann <arnd@arndb.de> writes:
>
>> We have several files on sparc that include linux/compat.h and expect
>> asm/compat.h not to be included, otherwise we get a build failure.
>
> Should this say: "We have several files on sparc that include
> linux/compat.h and expect asm/compat.h not be included when
> !CONFIG_COMPAT." ?
Correct, I'll fix it up. I'll say '32-bit builds' instead, which is what
I'm interested in. On sparc64, CONFIG_COMPAT is enabled
unconditionally, so it's really the same thing.
> I don't have your tree and I see asm/compat.h included from
> linux/compat.h already so the description above seems wrong.
I removed the tree from linux-next before the merge window because
of this build regression, if you are interested in the other changes,
please see
git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git y2038-next
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-11 20:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-11 15:07 [PATCH] sparc: compat: allow including asm/compat.h for 32-bit Arnd Bergmann
2018-04-11 19:32 ` Eric W. Biederman
2018-04-11 20:25 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).