* linux-next: manual merge of the mm-unstable tree with the tip-fixes tree
@ 2025-04-22 2:44 Stephen Rothwell
0 siblings, 0 replies; only message in thread
From: Stephen Rothwell @ 2025-04-22 2:44 UTC (permalink / raw)
To: Andrew Morton, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
Peter Zijlstra
Cc: Alexander Graf, Changyuan Lyu, Ingo Molnar,
Linux Kernel Mailing List, Linux Next Mailing List,
Mike Rapoport (Microsoft)
[-- Attachment #1: Type: text/plain, Size: 2191 bytes --]
Hi all,
Today's linux-next merge of the mm-unstable tree got a conflict in:
arch/x86/kernel/e820.c
between commit:
83b2d345e178 ("x86/e820: Discard high memory that can't be addressed by 32-bit systems")
from the tip-fixes tree and commit:
5a64fe1a39e7 ("x86: add KHO support")
from the mm-unstable tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc arch/x86/kernel/e820.c
index 9920122018a0,7d1c74681c61..000000000000
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@@ -1299,14 -1299,24 +1299,32 @@@ void __init e820__memblock_setup(void
memblock_add(entry->addr, entry->size);
}
+ /*
+ * 32-bit systems are limited to 4BG of memory even with HIGHMEM and
+ * to even less without it.
+ * Discard memory after max_pfn - the actual limit detected at runtime.
+ */
+ if (IS_ENABLED(CONFIG_X86_32))
+ memblock_remove(PFN_PHYS(max_pfn), -1);
+
+ /*
+ * At this point with KHO we only allocate from scratch memory.
+ * At the same time, we configure memblock to only allow
+ * allocations from memory below ISA_END_ADDRESS which is not
+ * a natural scratch region, because Linux ignores memory below
+ * ISA_END_ADDRESS at runtime. Beside very few (if any) early
+ * allocations, we must allocate real-mode trapoline below
+ * ISA_END_ADDRESS.
+ *
+ * To make sure that we can actually perform allocations during
+ * this phase, let's mark memory below ISA_END_ADDRESS as scratch
+ * so we can allocate from there in a scratch-only world.
+ *
+ * After real mode trampoline is allocated, we clear scratch
+ * marking from the memory below ISA_END_ADDRESS
+ */
+ memblock_mark_kho_scratch(0, ISA_END_ADDRESS);
+
/* Throw away partial pages: */
memblock_trim_memory(PAGE_SIZE);
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-22 2:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-22 2:44 linux-next: manual merge of the mm-unstable tree with the tip-fixes tree Stephen Rothwell
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®