All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] um: Fix header inclusion
@ 2020-03-23 12:41 Vincenzo Frascino
  2020-03-23 19:54 ` [tip: timers/core] " tip-bot2 for Vincenzo Frascino
  0 siblings, 1 reply; 2+ messages in thread
From: Vincenzo Frascino @ 2020-03-23 12:41 UTC (permalink / raw)
  To: linux-arch, linux-kernel, clang-built-linux, x86
  Cc: Vincenzo Frascino, kbuild test robot, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov

User Mode 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
the one reported below:

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: abc22418db02 ("x86/vdso: Enable x86 to use common headers")
Reported-by: kbuild test robot <lkp@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
Rebased on tip/master

 arch/x86/include/asm/vgtod.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h
index fc8e4cd342cc..7aa38b2ad8a9 100644
--- a/arch/x86/include/asm/vgtod.h
+++ b/arch/x86/include/asm/vgtod.h
@@ -2,6 +2,11 @@
 #ifndef _ASM_X86_VGTOD_H
 #define _ASM_X86_VGTOD_H
 
+/*
+ * This check is required to prevent ARCH=um to include
+ * unwanted headers.
+ */
+#ifdef CONFIG_GENERIC_GETTIMEOFDAY
 #include <linux/compiler.h>
 #include <asm/clocksource.h>
 #include <vdso/datapage.h>
@@ -14,5 +19,6 @@ typedef u64 gtod_long_t;
 #else
 typedef unsigned long gtod_long_t;
 #endif
+#endif /* CONFIG_GENERIC_GETTIMEOFDAY */
 
 #endif /* _ASM_X86_VGTOD_H */
-- 
2.25.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip: timers/core] um: Fix header inclusion
  2020-03-23 12:41 [PATCH] um: Fix header inclusion Vincenzo Frascino
@ 2020-03-23 19:54 ` tip-bot2 for Vincenzo Frascino
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Vincenzo Frascino @ 2020-03-23 19:54 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: kbuild test robot, Vincenzo Frascino, Borislav Petkov, x86, LKML

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     1c1a18b00d7e25d1bed3507880de2da07be704a2
Gitweb:        https://git.kernel.org/tip/1c1a18b00d7e25d1bed3507880de2da07be704a2
Author:        Vincenzo Frascino <vincenzo.frascino@arm.com>
AuthorDate:    Mon, 23 Mar 2020 12:41:09 
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Mon, 23 Mar 2020 18:45:14 +01:00

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: abc22418db02 ("x86/vdso: Enable x86 to use common headers")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200323124109.7104-1-vincenzo.frascino@arm.com
---
 arch/x86/include/asm/vgtod.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h
index fc8e4cd..7aa38b2 100644
--- a/arch/x86/include/asm/vgtod.h
+++ b/arch/x86/include/asm/vgtod.h
@@ -2,6 +2,11 @@
 #ifndef _ASM_X86_VGTOD_H
 #define _ASM_X86_VGTOD_H
 
+/*
+ * This check is required to prevent ARCH=um to include
+ * unwanted headers.
+ */
+#ifdef CONFIG_GENERIC_GETTIMEOFDAY
 #include <linux/compiler.h>
 #include <asm/clocksource.h>
 #include <vdso/datapage.h>
@@ -14,5 +19,6 @@ typedef u64 gtod_long_t;
 #else
 typedef unsigned long gtod_long_t;
 #endif
+#endif /* CONFIG_GENERIC_GETTIMEOFDAY */
 
 #endif /* _ASM_X86_VGTOD_H */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-23 19:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23 12:41 [PATCH] um: Fix header inclusion Vincenzo Frascino
2020-03-23 19:54 ` [tip: timers/core] " tip-bot2 for Vincenzo Frascino

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.