* [RFC PATCH for-stable] kbuild: Define LINUX_VERSION_{MAJOR,PATCHLEVEL,SUBLEVEL}
@ 2022-02-07 11:52 Jiaxun Yang
2022-02-07 12:01 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Jiaxun Yang @ 2022-02-07 11:52 UTC (permalink / raw)
To: gregkh; +Cc: stable, linux-kbuild, Jiaxun Yang
Since the SUBLEVEL overflowed LINUX_VERSION, we have no reliable
way to tell the current SUBLEVEL in source code.
This brings significant difficulties for backport works to deal
with changes in stable releases.
Define those macros so we can continue to get proper SUBLEVEL
in source without breaking stable ABI by refining KERNEL_VERSION
bit fields.
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
For some context: https://lore.kernel.org/backports/bb0ae37aa770e016463706d557fec1c5205bc6a9.camel@sipsolutions.net/T/#t
---
Makefile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 99d37c23495e..8132f81d94d8 100644
--- a/Makefile
+++ b/Makefile
@@ -1142,7 +1142,10 @@ endef
define filechk_version.h
(echo \#define LINUX_VERSION_CODE $(shell \
expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 255); \
- echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
+ echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
+ echo \#define LINUX_VERSION_MAJOR $(VERSION); \
+ echo \#define LINUX_VERSION_PATCHLEVEL $(PATCHLEVEL); \
+ echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL);)
endef
$(version_h): $(srctree)/Makefile FORCE
--
2.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RFC PATCH for-stable] kbuild: Define LINUX_VERSION_{MAJOR,PATCHLEVEL,SUBLEVEL}
2022-02-07 11:52 [RFC PATCH for-stable] kbuild: Define LINUX_VERSION_{MAJOR,PATCHLEVEL,SUBLEVEL} Jiaxun Yang
@ 2022-02-07 12:01 ` Greg KH
2022-02-07 12:47 ` Jiaxun Yang
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2022-02-07 12:01 UTC (permalink / raw)
To: Jiaxun Yang; +Cc: stable, linux-kbuild
On Mon, Feb 07, 2022 at 11:52:12AM +0000, Jiaxun Yang wrote:
> Since the SUBLEVEL overflowed LINUX_VERSION, we have no reliable
> way to tell the current SUBLEVEL in source code.
What in-kernel code needs to know the SUBLEVEL?
> This brings significant difficulties for backport works to deal
> with changes in stable releases.
What backport issues?
> Define those macros so we can continue to get proper SUBLEVEL
> in source without breaking stable ABI by refining KERNEL_VERSION
> bit fields.
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> For some context: https://lore.kernel.org/backports/bb0ae37aa770e016463706d557fec1c5205bc6a9.camel@sipsolutions.net/T/#t
> ---
> Makefile | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 99d37c23495e..8132f81d94d8 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1142,7 +1142,10 @@ endef
> define filechk_version.h
> (echo \#define LINUX_VERSION_CODE $(shell \
> expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 255); \
> - echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
> + echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
> + echo \#define LINUX_VERSION_MAJOR $(VERSION); \
> + echo \#define LINUX_VERSION_PATCHLEVEL $(PATCHLEVEL); \
> + echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL);)
This is already in Makefile, are you sure you just do not need to
backport a specific patch instead of making your own that does the same
thing?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH for-stable] kbuild: Define LINUX_VERSION_{MAJOR,PATCHLEVEL,SUBLEVEL}
2022-02-07 12:01 ` Greg KH
@ 2022-02-07 12:47 ` Jiaxun Yang
2022-02-07 13:15 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Jiaxun Yang @ 2022-02-07 12:47 UTC (permalink / raw)
To: Greg KH; +Cc: stable, linux-kbuild
在 2022/2/7 12:01, Greg KH 写道:
> On Mon, Feb 07, 2022 at 11:52:12AM +0000, Jiaxun Yang wrote:
>> Since the SUBLEVEL overflowed LINUX_VERSION, we have no reliable
>> way to tell the current SUBLEVEL in source code.
> What in-kernel code needs to know the SUBLEVEL?
Hi,
Ah sorry, to clarification, backport here means "Backport Project"
(https://backports.wiki.kernel.org).
Though it is not in-tree, it is a vital part of kernel ecosystem to
deliver some new drivers to stable kernels.
It relies on KERNEL_VERSION macros to enable compat code.
>
>> This brings significant difficulties for backport works to deal
>> with changes in stable releases.
> What backport issues?
Context:
https://lore.kernel.org/backports/bb0ae37aa770e016463706d557fec1c5205bc6a9.camel@sipsolutions.net/T/#t
We are nolonger able to detect linux version > 4.9.255 in source.
>
>> Define those macros so we can continue to get proper SUBLEVEL
>> in source without breaking stable ABI by refining KERNEL_VERSION
>> bit fields.
>>
>> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>> ---
>> For some context: https://lore.kernel.org/backports/bb0ae37aa770e016463706d557fec1c5205bc6a9.camel@sipsolutions.net/T/#t
>> ---
>> Makefile | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 99d37c23495e..8132f81d94d8 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1142,7 +1142,10 @@ endef
>> define filechk_version.h
>> (echo \#define LINUX_VERSION_CODE $(shell \
>> expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 255); \
>> - echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
>> + echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
>> + echo \#define LINUX_VERSION_MAJOR $(VERSION); \
>> + echo \#define LINUX_VERSION_PATCHLEVEL $(PATCHLEVEL); \
>> + echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL);)
> This is already in Makefile, are you sure you just do not need to
> backport
I wish this can be a part of existing stable kernels so backport project
can maintain flawless build againt stable kernels.
Thanks.
- Jiaxun
> a specific patch instead of making your own that does the same
> thing?
>
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH for-stable] kbuild: Define LINUX_VERSION_{MAJOR,PATCHLEVEL,SUBLEVEL}
2022-02-07 12:47 ` Jiaxun Yang
@ 2022-02-07 13:15 ` Greg KH
2022-02-07 13:33 ` Jiaxun Yang
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2022-02-07 13:15 UTC (permalink / raw)
To: Jiaxun Yang; +Cc: stable, linux-kbuild
On Mon, Feb 07, 2022 at 12:47:41PM +0000, Jiaxun Yang wrote:
>
>
> 在 2022/2/7 12:01, Greg KH 写道:
> > On Mon, Feb 07, 2022 at 11:52:12AM +0000, Jiaxun Yang wrote:
> > > Since the SUBLEVEL overflowed LINUX_VERSION, we have no reliable
> > > way to tell the current SUBLEVEL in source code.
> > What in-kernel code needs to know the SUBLEVEL?
> Hi,
>
> Ah sorry, to clarification, backport here means "Backport Project"
> (https://backports.wiki.kernel.org).
>
> Though it is not in-tree, it is a vital part of kernel ecosystem to
> deliver some new drivers to stable kernels.
>
> It relies on KERNEL_VERSION macros to enable compat code.
>
> >
> > > This brings significant difficulties for backport works to deal
> > > with changes in stable releases.
> > What backport issues?
> Context: https://lore.kernel.org/backports/bb0ae37aa770e016463706d557fec1c5205bc6a9.camel@sipsolutions.net/T/#t
>
> We are nolonger able to detect linux version > 4.9.255 in source.
Why do you need to do so?
> >
> > > Define those macros so we can continue to get proper SUBLEVEL
> > > in source without breaking stable ABI by refining KERNEL_VERSION
> > > bit fields.
> > >
> > > Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> > > ---
> > > For some context: https://lore.kernel.org/backports/bb0ae37aa770e016463706d557fec1c5205bc6a9.camel@sipsolutions.net/T/#t
> > > ---
> > > Makefile | 5 ++++-
> > > 1 file changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/Makefile b/Makefile
> > > index 99d37c23495e..8132f81d94d8 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -1142,7 +1142,10 @@ endef
> > > define filechk_version.h
> > > (echo \#define LINUX_VERSION_CODE $(shell \
> > > expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 255); \
> > > - echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
> > > + echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
> > > + echo \#define LINUX_VERSION_MAJOR $(VERSION); \
> > > + echo \#define LINUX_VERSION_PATCHLEVEL $(PATCHLEVEL); \
> > > + echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL);)
> > This is already in Makefile, are you sure you just do not need to
> > backport
> I wish this can be a part of existing stable kernels so backport project
> can maintain flawless build againt stable kernels.
My point being that you should not try to duplicate changes that are
already in Linus's tree. What I think you want is commit 88a686728b37
("kbuild: simplify access to the kernel's version") to be backported,
right?
If so, please provide a working backport for all affected kernels and we
will be glad to consider it.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH for-stable] kbuild: Define LINUX_VERSION_{MAJOR,PATCHLEVEL,SUBLEVEL}
2022-02-07 13:15 ` Greg KH
@ 2022-02-07 13:33 ` Jiaxun Yang
0 siblings, 0 replies; 5+ messages in thread
From: Jiaxun Yang @ 2022-02-07 13:33 UTC (permalink / raw)
To: Greg KH; +Cc: stable, linux-kbuild
在 2022/2/7 13:15, Greg KH 写道:
> On Mon, Feb 07, 2022 at 12:47:41PM +0000, Jiaxun Yang wrote:
>
> 在 2022/2/7 12:01, Greg KH 写道:
>>> On Mon, Feb 07, 2022 at 11:52:12AM +0000, Jiaxun Yang wrote:
[...]
> Why do you need to do so?
4.9.297 brings build_bug.h and breaks part of our compat code.
> My point being that you should not try to duplicate changes that are
> already in Linus's tree. What I think you want is commit 88a686728b37
> ("kbuild: simplify access to the kernel's version") to be backported,
> right?
>
> If so, please provide a working backport for all affected kernels and we
> will be glad to consider it.
Will do, thanks for pointing!
Thanks.
- Jiaxun
>
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-02-07 13:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-07 11:52 [RFC PATCH for-stable] kbuild: Define LINUX_VERSION_{MAJOR,PATCHLEVEL,SUBLEVEL} Jiaxun Yang
2022-02-07 12:01 ` Greg KH
2022-02-07 12:47 ` Jiaxun Yang
2022-02-07 13:15 ` Greg KH
2022-02-07 13:33 ` Jiaxun Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox