From 593bbd21955c092921e03dbe52d261939267da4c Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Thu, 2 Nov 2006 17:28:38 +0000 Subject: Revert the last change. Masking only 2 MSBs of the virtual address to get the physical address doesn't work for all values of KVA_PAGES, while masking 8 MSBs works for all values of KVA_PAGES that are multiple of 4 for non-PAE and 8 for PAE. (This leaves us limited with 12MB for non-PAE kernels and 14MB for PAE kernels.) To get things right, we'd need to subtract the KERNBASE from the virtual address (but KERNBASE is not easy to figure out from here), or have physical addresses set properly in the ELF headers. Discussed with: jhb --- sys/boot/common/load_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/boot/common') diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c index be8f8815b242..cd983a982dbf 100644 --- a/sys/boot/common/load_elf.c +++ b/sys/boot/common/load_elf.c @@ -263,7 +263,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) #if __ELF_WORD_SIZE == 64 off = - (off & 0xffffffffff000000ull);/* x86_64 relocates after locore */ #else - off = - (off & 0xc0000000u); /* i386 relocates after locore */ + off = - (off & 0xff000000u); /* i386 relocates after locore */ #endif #else off = 0; /* other archs use direct mapped kernels */ -- cgit v1.3