From 4f1132a88aaf368ecb02fe3a99cf0bce0ae19b7e Mon Sep 17 00:00:00 2001 From: Doug Ambrisko Date: Fri, 13 Aug 2004 22:30:55 +0000 Subject: [PATCH] Fix the memory scaling bug when basemem was converted to Kbytes from bytes for AMD64. Otherwise the AP will be started at 640K which won't work. Bug found on a Xeon 64bit system. --- sys/amd64/amd64/mp_machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index de6e06d5ed1..69c5c0f4dfd 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -198,7 +198,7 @@ mp_bootaddress(u_int basemem) bootMP_size = mptramp_end - mptramp_start; boot_address = trunc_page(basemem * 1024); /* round down to 4k boundary */ - if ((basemem - boot_address) < bootMP_size) + if (((basemem * 1024) - boot_address) < bootMP_size) boot_address -= PAGE_SIZE; /* not enough, lower by 4k */ /* 3 levels of page table pages */ mptramp_pagetables = boot_address - (PAGE_SIZE * 3);