Skip to content

Commit 1c1a18b

Browse files
fvincenzosuryasaimadhu
authored andcommitted
um: Fix header inclusion
User Mode Linux is a flavor of x86 that from the vDSO prospective always falls back on system calls. This implies that it does not require any of the unified vDSO definitions and their inclusion causes side effects like this: In file included from include/vdso/processor.h:10:0, from include/vdso/datapage.h:17, from arch/x86/include/asm/vgtod.h:7, from arch/x86/um/../kernel/sys_ia32.c:49: >> arch/x86/include/asm/vdso/processor.h:11:29: error: redefinition of 'rep_nop' static __always_inline void rep_nop(void) ^~~~~~~ In file included from include/linux/rcupdate.h:30:0, from include/linux/rculist.h:11, from include/linux/pid.h:5, from include/linux/sched.h:14, from arch/x86/um/../kernel/sys_ia32.c:25: arch/x86/um/asm/processor.h:24:20: note: previous definition of 'rep_nop' was here static inline void rep_nop(void) Make sure that the unnecessary headers are not included when um is built to address the problem. Fixes: abc2241 ("x86/vdso: Enable x86 to use common headers") Reported-by: kbuild test robot <[email protected]> Signed-off-by: Vincenzo Frascino <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent a5d442f commit 1c1a18b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/x86/include/asm/vgtod.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
#ifndef _ASM_X86_VGTOD_H
33
#define _ASM_X86_VGTOD_H
44

5+
/*
6+
* This check is required to prevent ARCH=um to include
7+
* unwanted headers.
8+
*/
9+
#ifdef CONFIG_GENERIC_GETTIMEOFDAY
510
#include <linux/compiler.h>
611
#include <asm/clocksource.h>
712
#include <vdso/datapage.h>
@@ -14,5 +19,6 @@ typedef u64 gtod_long_t;
1419
#else
1520
typedef unsigned long gtod_long_t;
1621
#endif
22+
#endif /* CONFIG_GENERIC_GETTIMEOFDAY */
1723

1824
#endif /* _ASM_X86_VGTOD_H */

0 commit comments

Comments
 (0)