mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [tip: x86/mm] x86/mm: Add missing <asm/cpufeatures.h> dependency to <asm/page_64.h>
@ 2021-12-03 17:38 tip-bot2 for Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2021-12-03 17:38 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Linus Torvalds, Borislav Petkov, Thomas Gleixner, Ingo Molnar,
	x86, linux-kernel

The following commit has been merged into the x86/mm branch of tip:

Commit-ID:     e1cd82a339024beda8439fb2e20718363ee989a8
Gitweb:        https://git.kernel.org/tip/e1cd82a339024beda8439fb2e20718363ee989a8
Author:        Ingo Molnar <mingo@kernel.org>
AuthorDate:    Tue, 16 Nov 2021 06:13:05 +01:00
Committer:     Dave Hansen <dave.hansen@linux.intel.com>
CommitterDate: Fri, 03 Dec 2021 09:30:45 -08:00

x86/mm: Add missing <asm/cpufeatures.h> dependency to <asm/page_64.h>

In the following commit:

  025768a966a3 x86/cpu: Use alternative to generate the TASK_SIZE_MAX constant

... we added the new task_size_max() inline, which uses X86_FEATURE_LA57,
but doesn't include <asm/cpufeatures.h> which defines the constant.

Due to the way alternatives macros work currently this doesn't get reported as an
immediate build error, only as a link error, if a .c file happens to include
<asm/page.h> first:

   > ld: kernel/fork.o:(.altinstructions+0x98): undefined reference to `X86_FEATURE_LA57'

In the current upstream kernel no .c file includes <asm/page.h> before including
some other header that includes <asm/cpufeatures.h>, which is why this dependency
bug went unnoticed.

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/asm/page_64.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/include/asm/page_64.h b/arch/x86/include/asm/page_64.h
index 4bde0dc..e9c8629 100644
--- a/arch/x86/include/asm/page_64.h
+++ b/arch/x86/include/asm/page_64.h
@@ -5,6 +5,7 @@
 #include <asm/page_64_types.h>
 
 #ifndef __ASSEMBLY__
+#include <asm/cpufeatures.h>
 #include <asm/alternative.h>
 
 /* duplicated to the one in bootmem.h */

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [tip: x86/mm] x86/mm: Add missing <asm/cpufeatures.h> dependency to <asm/page_64.h>
@ 2021-11-16  5:25 tip-bot2 for Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2021-11-16  5:25 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Linus Torvalds, Borislav Petkov, Thomas Gleixner, Ingo Molnar,
	x86, linux-kernel

The following commit has been merged into the x86/mm branch of tip:

Commit-ID:     19c88fc96d941dd7102399bbf7f437f2b93d7e4e
Gitweb:        https://git.kernel.org/tip/19c88fc96d941dd7102399bbf7f437f2b93d7e4e
Author:        Ingo Molnar <mingo@kernel.org>
AuthorDate:    Tue, 16 Nov 2021 06:13:05 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 16 Nov 2021 06:22:01 +01:00

x86/mm: Add missing <asm/cpufeatures.h> dependency to <asm/page_64.h>

In the following commit:

  025768a966a3 x86/cpu: Use alternative to generate the TASK_SIZE_MAX constant

... we added the new task_size_max() inline, which uses X86_FEATURE_LA57,
but doesn't include <asm/cpufeatures.h> which defines the constant.

Due to the way alternatives macros work currently this doesn't get reported as an
immediate build error, only as a link error, if a .c file happens to include
<asm/page.h> first:

   > ld: kernel/fork.o:(.altinstructions+0x98): undefined reference to `X86_FEATURE_LA57'

In the current upstream kernel no .c file includes <asm/page.h> before including
some other header that includes <asm/cpufeatures.h>, which is why this dependency
bug went unnoticed.

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/asm/page_64.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/include/asm/page_64.h b/arch/x86/include/asm/page_64.h
index 4bde0dc..e9c8629 100644
--- a/arch/x86/include/asm/page_64.h
+++ b/arch/x86/include/asm/page_64.h
@@ -5,6 +5,7 @@
 #include <asm/page_64_types.h>
 
 #ifndef __ASSEMBLY__
+#include <asm/cpufeatures.h>
 #include <asm/alternative.h>
 
 /* duplicated to the one in bootmem.h */

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

end of thread, other threads:[~2021-12-03 17:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 17:38 [tip: x86/mm] x86/mm: Add missing <asm/cpufeatures.h> dependency to <asm/page_64.h> tip-bot2 for Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2021-11-16  5:25 tip-bot2 for Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®