aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWANG Chao <chaowang@redhat.com>2014-03-10 10:52:00 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2014-04-10 22:51:32 -0400
commit0534af01cca338193abbfdb53650af91e65dbf10 (patch)
tree420c080426b959c5ee10e40b8cc43af66c5b87f6
parentc71ef7b3c3be3337deaf1eb28dd26e0d5d4b4aa7 (diff)
x86, calgary: Use 8M TCE table size by default
New kexec-tools wants to pass kdump kernel needed memmap via E820 directly, instead of memmap=exactmap. This makes saved_max_pfn not be passed down to 2nd kernel. To keep 1st kernel and 2nd kernel using the same TCE table size, Muli suggest to hard code the size to max (8M). We can't get rid of saved_max_pfn this time, for backward compatibility with old first kernel and new second kernel. However new first kernel and old second kernel can not work unfortunately. v2->v1: - retain saved_max_pfn so new 2nd kernel can work with old 1st kernel from Vivek Signed-off-by: WANG Chao <chaowang@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Acked-by: Muli Ben-Yehuda <mulix@mulix.org> Acked-by: Jon Mason <jdmason@kudzu.us> Link: http://lkml.kernel.org/r/1394463120-26999-1-git-send-email-chaowang@redhat.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--arch/x86/kernel/pci-calgary_64.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 299d49302e7d..0497f719977d 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -1207,23 +1207,31 @@ error:
1207 return ret; 1207 return ret;
1208} 1208}
1209 1209
1210static inline int __init determine_tce_table_size(u64 ram) 1210static inline int __init determine_tce_table_size(void)
1211{ 1211{
1212 int ret; 1212 int ret;
1213 1213
1214 if (specified_table_size != TCE_TABLE_SIZE_UNSPECIFIED) 1214 if (specified_table_size != TCE_TABLE_SIZE_UNSPECIFIED)
1215 return specified_table_size; 1215 return specified_table_size;
1216 1216
1217 /* 1217 if (is_kdump_kernel() && saved_max_pfn) {
1218 * Table sizes are from 0 to 7 (TCE_TABLE_SIZE_64K to 1218 /*
1219 * TCE_TABLE_SIZE_8M). Table size 0 has 8K entries and each 1219 * Table sizes are from 0 to 7 (TCE_TABLE_SIZE_64K to
1220 * larger table size has twice as many entries, so shift the 1220 * TCE_TABLE_SIZE_8M). Table size 0 has 8K entries and each
1221 * max ram address by 13 to divide by 8K and then look at the 1221 * larger table size has twice as many entries, so shift the
1222 * order of the result to choose between 0-7. 1222 * max ram address by 13 to divide by 8K and then look at the
1223 */ 1223 * order of the result to choose between 0-7.
1224 ret = get_order(ram >> 13); 1224 */
1225 if (ret > TCE_TABLE_SIZE_8M) 1225 ret = get_order((saved_max_pfn * PAGE_SIZE) >> 13);
1226 if (ret > TCE_TABLE_SIZE_8M)
1227 ret = TCE_TABLE_SIZE_8M;
1228 } else {
1229 /*
1230 * Use 8M by default (suggested by Muli) if it's not
1231 * kdump kernel and saved_max_pfn isn't set.
1232 */
1226 ret = TCE_TABLE_SIZE_8M; 1233 ret = TCE_TABLE_SIZE_8M;
1234 }
1227 1235
1228 return ret; 1236 return ret;
1229} 1237}
@@ -1418,8 +1426,7 @@ int __init detect_calgary(void)
1418 return -ENOMEM; 1426 return -ENOMEM;
1419 } 1427 }
1420 1428
1421 specified_table_size = determine_tce_table_size((is_kdump_kernel() ? 1429 specified_table_size = determine_tce_table_size();
1422 saved_max_pfn : max_pfn) * PAGE_SIZE);
1423 1430
1424 for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) { 1431 for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) {
1425 struct calgary_bus_info *info = &bus_info[bus]; 1432 struct calgary_bus_info *info = &bus_info[bus];