[kvm-unit-tests PATCH] x86: on 32-bit do not initialize memory above 2GB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Nadav Amit <namit@xxxxxxxxxx>

taskswitch2 test fails on certain configurations with more than 2GB of
memory.

The reason is that on i386, setup_mmu() creates a hole above 2GB and
does not map that area.

Do not initialize the memory above 2GB on i386.

Signed-off-by: Nadav Amit <namit@xxxxxxxxxx>
---
 lib/x86/setup.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/x86/setup.c b/lib/x86/setup.c
index 7befe09..001853c 100644
--- a/lib/x86/setup.c
+++ b/lib/x86/setup.c
@@ -107,6 +107,15 @@ void setup_multiboot(struct mbi_bootinfo *bi)
 
 	u64 best_start = (uintptr_t) &edata;
 	u64 best_end = bootinfo->mem_upper * 1024ull;
+
+#ifndef __x86_64__
+	/*
+	 * On i386, setup_mmu() creates a hole above 2GB, so do not initialize
+	 * the memory above 2GB.
+	 */
+	if (best_end > 2ul << 30)
+		best_end = 2ul << 30;
+#endif
 	phys_alloc_init(best_start, best_end - best_start);
 
 	if (bootinfo->mods_count != 1)
-- 
2.25.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux