Message ID | 20210313073020.36984-1-namit@vmware.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [kvm-unit-tests] x86: on 32-bit do not initialize memory above 2GB | expand |
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)