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(a)flygoat.com>
---
For some context: https://lore.kernel.org/backports/bb0ae37aa770e016463706d557fec1c5205bc6a9.…
---
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
On Mon, Feb 07, 2022 at 10:03:29AM +0000, 罗飞 wrote:
> >I think he's trying to fix the backport:
> >
> >see 26f8c38bb466c1a2d232d7609fb4bfb4bc121678 which is the stable tree backport:
> >
> >@@ -582,7 +586,8 @@ static int srao_decode_notifier(struct notifier_block *nb, unsigned long val,
> >
> > if (mce_usable_address(mce) && (mce->severity == MCE_AO_SEVERITY)) {
> > pfn = mce->addr >> PAGE_SHIFT;
> >- memory_failure(pfn, MCE_VECTOR, 0);
> >+ if (memory_failure(pfn, MCE_VECTOR, 0))
> >+ mce_unmap_kpfn(pfn);
> > }
> >
> >
> >vs the upstream commit:
> >
> >fd0e786d9d09024f67bd71ec094b110237dc3840
> >
> >@@ -590,7 +594,8 @@ static int srao_decode_notifier(struct notifier_block *nb, unsigned long val,
> >
> > if (mce_usable_address(mce) && (mce->severity == MCE_AO_SEVERITY)) {
> > pfn = mce->addr >> PAGE_SHIFT;
> >- memory_failure(pfn, 0);
> >+ if (!memory_failure(pfn, 0))
> >+ mce_unmap_kpfn(pfn);
> > }
> >
> > return NOTIFY_OK;
>
>
> Sorry for my not familiar with submitting patches to stable kernel tree, and here Borislav Petkov said exactly what I meant
Great, can you please resend this and document what this patch is doing
and why it is not in upstream and why is it needed only in this one
branch?
thanks,
greg k-h