* [PATCH] Kbuild: Handle PREEMPT_RT for version string and magic
@ 2019-07-26 20:48 Thomas Gleixner
2019-07-28 4:12 ` Masahiro Yamada
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2019-07-26 20:48 UTC (permalink / raw)
To: LKML
Cc: Masahiro Yamada, Michal Marek, linux-kbuild, Peter Zijlstra,
Ingo Molnar, Steven Rostedt, Sebastian Sewior
Update the build scripts and the version magic to reflect when
CONFIG_PREEMPT_RT is enabled in the same way as CONFIG_PREEMPT is treated.
The resulting version strings:
Linux m 5.3.0-rc1+ #100 SMP Fri Jul 26 ...
Linux m 5.3.0-rc1+ #101 SMP PREEMPT Fri Jul 26 ...
Linux m 5.3.0-rc1+ #102 SMP PREEMPT_RT Fri Jul 26 ...
The module vermagic:
5.3.0-rc1+ SMP mod_unload modversions
5.3.0-rc1+ SMP preempt mod_unload modversions
5.3.0-rc1+ SMP preempt_rt mod_unload modversions
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: linux-kbuild@vger.kernel.org
---
include/linux/vermagic.h | 10 +++++++---
init/Makefile | 5 +++--
scripts/Makefile.modpost | 2 +-
scripts/mkcompile_h | 4 +++-
4 files changed, 14 insertions(+), 7 deletions(-)
--- a/include/linux/vermagic.h
+++ b/include/linux/vermagic.h
@@ -7,10 +7,14 @@
#else
#define MODULE_VERMAGIC_SMP ""
#endif
-#ifdef CONFIG_PREEMPT
-#define MODULE_VERMAGIC_PREEMPT "preempt "
+#ifdef CONFIG_PREEMPTION
+# ifdef CONFIG_PREEMPT
+# define MODULE_VERMAGIC_PREEMPT "preempt "
+# else
+# define MODULE_VERMAGIC_PREEMPT "preempt_rt "
+# endif
#else
-#define MODULE_VERMAGIC_PREEMPT ""
+# define MODULE_VERMAGIC_PREEMPT ""
#endif
#ifdef CONFIG_MODULE_UNLOAD
#define MODULE_VERMAGIC_MODULE_UNLOAD "mod_unload "
--- a/init/Makefile
+++ b/init/Makefile
@@ -33,5 +33,6 @@ mounts-$(CONFIG_BLK_DEV_MD) += do_mounts
silent_chk_compile.h = :
include/generated/compile.h: FORCE
@$($(quiet)chk_compile.h)
- $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
- "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)"
+ $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
+ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" \
+ "$(CONFIG_PREEMPT_RT)" "$(CC) $(KBUILD_CFLAGS)"
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -23,7 +23,7 @@
# Version magic (see include/linux/vermagic.h for full details)
# - Kernel release
# - SMP is CONFIG_SMP
-# - PREEMPT is CONFIG_PREEMPT
+# - PREEMPT is CONFIG_PREEMPT[_RT]
# - GCC Version
# Module info
# - Module version (MODULE_VERSION)
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -5,7 +5,8 @@ TARGET=$1
ARCH=$2
SMP=$3
PREEMPT=$4
-CC=$5
+PREEMPT_RT=$5
+CC=$6
vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }
@@ -53,6 +54,7 @@ UTS_VERSION="#$VERSION"
CONFIG_FLAGS=""
if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
+if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi
UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
# Truncate to maximum length
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Kbuild: Handle PREEMPT_RT for version string and magic
2019-07-26 20:48 [PATCH] Kbuild: Handle PREEMPT_RT for version string and magic Thomas Gleixner
@ 2019-07-28 4:12 ` Masahiro Yamada
2019-07-28 9:13 ` Thomas Gleixner
0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2019-07-28 4:12 UTC (permalink / raw)
To: Thomas Gleixner
Cc: LKML, Michal Marek, Linux Kbuild mailing list, Peter Zijlstra,
Ingo Molnar, Steven Rostedt, Sebastian Sewior
Hi Thomas,
On Sat, Jul 27, 2019 at 5:49 AM Thomas Gleixner <tglx@linutronix.de> wrote:
>
> Update the build scripts and the version magic to reflect when
> CONFIG_PREEMPT_RT is enabled in the same way as CONFIG_PREEMPT is treated.
>
> The resulting version strings:
>
> Linux m 5.3.0-rc1+ #100 SMP Fri Jul 26 ...
> Linux m 5.3.0-rc1+ #101 SMP PREEMPT Fri Jul 26 ...
> Linux m 5.3.0-rc1+ #102 SMP PREEMPT_RT Fri Jul 26 ...
>
> The module vermagic:
>
> 5.3.0-rc1+ SMP mod_unload modversions
> 5.3.0-rc1+ SMP preempt mod_unload modversions
> 5.3.0-rc1+ SMP preempt_rt mod_unload modversions
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: Michal Marek <michal.lkml@markovi.net>
> Cc: linux-kbuild@vger.kernel.org
Since CONFIG_PREEMPTION was introduced after -rc1,
I think this should be queued on top of -rc2.
Just a nit below.
> ---
> include/linux/vermagic.h | 10 +++++++---
> init/Makefile | 5 +++--
> scripts/Makefile.modpost | 2 +-
> scripts/mkcompile_h | 4 +++-
> 4 files changed, 14 insertions(+), 7 deletions(-)
>
> --- a/include/linux/vermagic.h
> +++ b/include/linux/vermagic.h
> @@ -7,10 +7,14 @@
> #else
> #define MODULE_VERMAGIC_SMP ""
> #endif
> -#ifdef CONFIG_PREEMPT
> -#define MODULE_VERMAGIC_PREEMPT "preempt "
> +#ifdef CONFIG_PREEMPTION
> +# ifdef CONFIG_PREEMPT
> +# define MODULE_VERMAGIC_PREEMPT "preempt "
> +# else
> +# define MODULE_VERMAGIC_PREEMPT "preempt_rt "
> +# endif
> #else
> -#define MODULE_VERMAGIC_PREEMPT ""
> +# define MODULE_VERMAGIC_PREEMPT ""
Maybe, is the following more readable?
#if defined(CONFIG_PREEMPT_RT)
#define MODULE_VERMAGIC_PREEMPT "preempt_rt "
#elif defined(CONFIG_PREEMPT)
#define MODULE_VERMAGIC_PREEMPT "preempt "
#else
#define MODULE_VERMAGIC_PREEMPT ""
#endif
Thanks.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Kbuild: Handle PREEMPT_RT for version string and magic
2019-07-28 4:12 ` Masahiro Yamada
@ 2019-07-28 9:13 ` Thomas Gleixner
2019-07-28 18:27 ` [PATCH V2] " Thomas Gleixner
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2019-07-28 9:13 UTC (permalink / raw)
To: Masahiro Yamada
Cc: LKML, Michal Marek, Linux Kbuild mailing list, Peter Zijlstra,
Ingo Molnar, Steven Rostedt, Sebastian Sewior
Masahiro,
On Sun, 28 Jul 2019, Masahiro Yamada wrote:
>
> Since CONFIG_PREEMPTION was introduced after -rc1,
> I think this should be queued on top of -rc2.
Right. Are you picking it up?
> > -#ifdef CONFIG_PREEMPT
> > -#define MODULE_VERMAGIC_PREEMPT "preempt "
> > +#ifdef CONFIG_PREEMPTION
> > +# ifdef CONFIG_PREEMPT
> > +# define MODULE_VERMAGIC_PREEMPT "preempt "
> > +# else
> > +# define MODULE_VERMAGIC_PREEMPT "preempt_rt "
> > +# endif
> > #else
> > -#define MODULE_VERMAGIC_PREEMPT ""
> > +# define MODULE_VERMAGIC_PREEMPT ""
>
> Maybe, is the following more readable?
>
> #if defined(CONFIG_PREEMPT_RT)
> #define MODULE_VERMAGIC_PREEMPT "preempt_rt "
> #elif defined(CONFIG_PREEMPT)
> #define MODULE_VERMAGIC_PREEMPT "preempt "
> #else
> #define MODULE_VERMAGIC_PREEMPT ""
> #endif
Doh. That's obvious. Must be a result of the heat wave we had.
Will send a V2.
Thanks,
tglx
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH V2] Kbuild: Handle PREEMPT_RT for version string and magic
2019-07-28 9:13 ` Thomas Gleixner
@ 2019-07-28 18:27 ` Thomas Gleixner
2019-07-29 2:22 ` Masahiro Yamada
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2019-07-28 18:27 UTC (permalink / raw)
To: Masahiro Yamada
Cc: LKML, Michal Marek, Linux Kbuild mailing list, Peter Zijlstra,
Ingo Molnar, Steven Rostedt, Sebastian Sewior
Update the build scripts and the version magic to reflect when
CONFIG_PREEMPT_RT is enabled in the same way as CONFIG_PREEMPT is treated.
The resulting version strings:
Linux m 5.3.0-rc1+ #100 SMP Fri Jul 26 ...
Linux m 5.3.0-rc1+ #101 SMP PREEMPT Fri Jul 26 ...
Linux m 5.3.0-rc1+ #102 SMP PREEMPT_RT Fri Jul 26 ...
The module vermagic:
5.3.0-rc1+ SMP mod_unload modversions
5.3.0-rc1+ SMP preempt mod_unload modversions
5.3.0-rc1+ SMP preempt_rt mod_unload modversions
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: linux-kbuild@vger.kernel.org
---
V2: Simplify the ifdeffery as pointed out by Masahiro
---
include/linux/vermagic.h | 2 ++
init/Makefile | 5 +++--
scripts/Makefile.modpost | 2 +-
scripts/mkcompile_h | 4 +++-
4 files changed, 9 insertions(+), 4 deletions(-)
--- a/include/linux/vermagic.h
+++ b/include/linux/vermagic.h
@@ -9,6 +9,8 @@
#endif
#ifdef CONFIG_PREEMPT
#define MODULE_VERMAGIC_PREEMPT "preempt "
+#elif defined(CONFIG_PREEMPT_RT)
+#define MODULE_VERMAGIC_PREEMPT "preempt_rt "
#else
#define MODULE_VERMAGIC_PREEMPT ""
#endif
--- a/init/Makefile
+++ b/init/Makefile
@@ -33,5 +33,6 @@ mounts-$(CONFIG_BLK_DEV_MD) += do_mounts
silent_chk_compile.h = :
include/generated/compile.h: FORCE
@$($(quiet)chk_compile.h)
- $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
- "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)"
+ $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
+ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" \
+ "$(CONFIG_PREEMPT_RT)" "$(CC) $(KBUILD_CFLAGS)"
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -23,7 +23,7 @@
# Version magic (see include/linux/vermagic.h for full details)
# - Kernel release
# - SMP is CONFIG_SMP
-# - PREEMPT is CONFIG_PREEMPT
+# - PREEMPT is CONFIG_PREEMPT[_RT]
# - GCC Version
# Module info
# - Module version (MODULE_VERSION)
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -5,7 +5,8 @@ TARGET=$1
ARCH=$2
SMP=$3
PREEMPT=$4
-CC=$5
+PREEMPT_RT=$5
+CC=$6
vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }
@@ -53,6 +54,7 @@ UTS_VERSION="#$VERSION"
CONFIG_FLAGS=""
if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
+if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi
UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
# Truncate to maximum length
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2] Kbuild: Handle PREEMPT_RT for version string and magic
2019-07-28 18:27 ` [PATCH V2] " Thomas Gleixner
@ 2019-07-29 2:22 ` Masahiro Yamada
0 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2019-07-29 2:22 UTC (permalink / raw)
To: Thomas Gleixner
Cc: LKML, Michal Marek, Linux Kbuild mailing list, Peter Zijlstra,
Ingo Molnar, Steven Rostedt, Sebastian Sewior
On Mon, Jul 29, 2019 at 3:27 AM Thomas Gleixner <tglx@linutronix.de> wrote:
>
> Update the build scripts and the version magic to reflect when
> CONFIG_PREEMPT_RT is enabled in the same way as CONFIG_PREEMPT is treated.
>
> The resulting version strings:
>
> Linux m 5.3.0-rc1+ #100 SMP Fri Jul 26 ...
> Linux m 5.3.0-rc1+ #101 SMP PREEMPT Fri Jul 26 ...
> Linux m 5.3.0-rc1+ #102 SMP PREEMPT_RT Fri Jul 26 ...
>
> The module vermagic:
>
> 5.3.0-rc1+ SMP mod_unload modversions
> 5.3.0-rc1+ SMP preempt mod_unload modversions
> 5.3.0-rc1+ SMP preempt_rt mod_unload modversions
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: Michal Marek <michal.lkml@markovi.net>
> Cc: linux-kbuild@vger.kernel.org
> ---
> V2: Simplify the ifdeffery as pointed out by Masahiro
Applied to linux-kbuild.
Thanks.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-07-29 2:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26 20:48 [PATCH] Kbuild: Handle PREEMPT_RT for version string and magic Thomas Gleixner
2019-07-28 4:12 ` Masahiro Yamada
2019-07-28 9:13 ` Thomas Gleixner
2019-07-28 18:27 ` [PATCH V2] " Thomas Gleixner
2019-07-29 2:22 ` Masahiro Yamada
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).