diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-07-10 23:38:26 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-11 04:24:04 -0400 |
commit | f361a450bf1ad14e2b003217dbf3958638631265 (patch) | |
tree | 10c1e4dcc0047f6c37387cada6a0bceba088d2d2 /arch/x86/kernel/e820.c | |
parent | f302a5bbe5eb95f3d4227d5bd0e9b92b1b125f4f (diff) |
x86: introduce max_low_pfn_mapped for 64-bit
when more than 4g memory is installed, don't map the big hole below 4g.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/e820.c')
-rw-r--r-- | arch/x86/kernel/e820.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 3451e0b3f324..9f5002e0b35c 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -1056,7 +1056,7 @@ unsigned long __initdata end_user_pfn = MAX_ARCH_PFN; | |||
1056 | /* | 1056 | /* |
1057 | * Find the highest page frame number we have available | 1057 | * Find the highest page frame number we have available |
1058 | */ | 1058 | */ |
1059 | unsigned long __init e820_end(void) | 1059 | static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type) |
1060 | { | 1060 | { |
1061 | int i; | 1061 | int i; |
1062 | unsigned long last_pfn = 0; | 1062 | unsigned long last_pfn = 0; |
@@ -1064,12 +1064,21 @@ unsigned long __init e820_end(void) | |||
1064 | 1064 | ||
1065 | for (i = 0; i < e820.nr_map; i++) { | 1065 | for (i = 0; i < e820.nr_map; i++) { |
1066 | struct e820entry *ei = &e820.map[i]; | 1066 | struct e820entry *ei = &e820.map[i]; |
1067 | unsigned long start_pfn; | ||
1067 | unsigned long end_pfn; | 1068 | unsigned long end_pfn; |
1068 | 1069 | ||
1069 | if (ei->type != E820_RAM) | 1070 | if (ei->type != type) |
1070 | continue; | 1071 | continue; |
1071 | 1072 | ||
1073 | start_pfn = ei->addr >> PAGE_SHIFT; | ||
1072 | end_pfn = (ei->addr + ei->size) >> PAGE_SHIFT; | 1074 | end_pfn = (ei->addr + ei->size) >> PAGE_SHIFT; |
1075 | |||
1076 | if (start_pfn >= limit_pfn) | ||
1077 | continue; | ||
1078 | if (end_pfn > limit_pfn) { | ||
1079 | last_pfn = limit_pfn; | ||
1080 | break; | ||
1081 | } | ||
1073 | if (end_pfn > last_pfn) | 1082 | if (end_pfn > last_pfn) |
1074 | last_pfn = end_pfn; | 1083 | last_pfn = end_pfn; |
1075 | } | 1084 | } |
@@ -1083,7 +1092,15 @@ unsigned long __init e820_end(void) | |||
1083 | last_pfn, max_arch_pfn); | 1092 | last_pfn, max_arch_pfn); |
1084 | return last_pfn; | 1093 | return last_pfn; |
1085 | } | 1094 | } |
1095 | unsigned long __init e820_end_of_ram_pfn(void) | ||
1096 | { | ||
1097 | return e820_end_pfn(MAX_ARCH_PFN, E820_RAM); | ||
1098 | } | ||
1086 | 1099 | ||
1100 | unsigned long __init e820_end_of_low_ram_pfn(void) | ||
1101 | { | ||
1102 | return e820_end_pfn(1UL<<(32 - PAGE_SHIFT), E820_RAM); | ||
1103 | } | ||
1087 | /* | 1104 | /* |
1088 | * Finds an active region in the address range from start_pfn to last_pfn and | 1105 | * Finds an active region in the address range from start_pfn to last_pfn and |
1089 | * returns its range in ei_startpfn and ei_endpfn for the e820 entry. | 1106 | * returns its range in ei_startpfn and ei_endpfn for the e820 entry. |
@@ -1206,7 +1223,7 @@ static int __init parse_memmap_opt(char *p) | |||
1206 | * the real mem size before original memory map is | 1223 | * the real mem size before original memory map is |
1207 | * reset. | 1224 | * reset. |
1208 | */ | 1225 | */ |
1209 | saved_max_pfn = e820_end(); | 1226 | saved_max_pfn = e820_end_of_ram_pfn(); |
1210 | #endif | 1227 | #endif |
1211 | e820.nr_map = 0; | 1228 | e820.nr_map = 0; |
1212 | userdef = 1; | 1229 | userdef = 1; |