diff options
author | Bernhard Walle <bwalle@suse.de> | 2008-05-14 18:40:40 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-05-14 18:40:40 -0400 |
commit | 8a3360f06cd4d3b1d57f73e029f2f8b6057fdcba (patch) | |
tree | 299eee7ef2848e29cec8894fd9e13c7151771c21 /arch/ia64/kernel/setup.c | |
parent | 2224661494278bfc1c35b392cf6ee6f58e1d5e64 (diff) |
[IA64] Don't reserve crashkernel memory > 4 GB
Some IA64 machines map all cell-local memory above 4 GB (32 bit limit).
However, in most cases, the kernel needs some memory below that limit that is
DMA-capable. So in this machine configuration, the crashkernel will be reserved
above 4 GB.
For machines that use SWIOTLB implementation because they lack an I/O MMU
the low memory is required by the SWIOTLB implementation. In that case,
it doesn't make sense to reserve the crashkernel at all because it's unusable
for kdump.
A special case is the "hpzx1" machine vector. In theory, it has a I/O MMU, so
it can be booted above 4 GB. However, in the kdump case that is not possible
because of changeset 51b58e3e26ebfb8cd56825c4b396ed251f51dec9:
On HP zx1 machines, the 'machvec=dig' parameter is needed for the kdump
kernel to avoid problems with the HP sba iommu. The problem is that during
the boot of the kdump kernel, the iommu is re-initialized, so in-flight DMA
from improperly shutdown drivers causes an IOTLB miss which leads to an
MCA. With kdump, the idea is to get into the kdump kernel with as little
code as we can, so shutting down drivers properly is not an option.
The workaround is to add 'machvec=dig' to the kdump kernel boot parameters.
This makes the kdump kernel avoid using the sba iommu altogether, leaving
the IOTLB intact. Any ongoing DMA falls harmlessly outside the kdump
kernel. After the kdump kernel reboots, all devices will have been
shutdown properly and DMA stopped.
This patch pushes that functionality into the sba iommu initialization
code, so that users won't have to find the obscure documentation telling
them about 'machvec=dig'.
This means that also for hpzx1 it's not possible to boot when all
memory is above the 4 GB limit. So the only machine vectors that can handle
this case are "sn2" and "uv".
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/setup.c')
-rw-r--r-- | arch/ia64/kernel/setup.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 5015ca1275ca..e9596cd0cdab 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -239,6 +239,25 @@ __initcall(register_memory); | |||
239 | 239 | ||
240 | 240 | ||
241 | #ifdef CONFIG_KEXEC | 241 | #ifdef CONFIG_KEXEC |
242 | |||
243 | /* | ||
244 | * This function checks if the reserved crashkernel is allowed on the specific | ||
245 | * IA64 machine flavour. Machines without an IO TLB use swiotlb and require | ||
246 | * some memory below 4 GB (i.e. in 32 bit area), see the implementation of | ||
247 | * lib/swiotlb.c. The hpzx1 architecture has an IO TLB but cannot use that | ||
248 | * in kdump case. See the comment in sba_init() in sba_iommu.c. | ||
249 | * | ||
250 | * So, the only machvec that really supports loading the kdump kernel | ||
251 | * over 4 GB is "sn2". | ||
252 | */ | ||
253 | static int __init check_crashkernel_memory(unsigned long pbase, size_t size) | ||
254 | { | ||
255 | if (ia64_platform_is("sn2") || ia64_platform_is("uv")) | ||
256 | return 1; | ||
257 | else | ||
258 | return pbase < (1UL << 32); | ||
259 | } | ||
260 | |||
242 | static void __init setup_crashkernel(unsigned long total, int *n) | 261 | static void __init setup_crashkernel(unsigned long total, int *n) |
243 | { | 262 | { |
244 | unsigned long long base = 0, size = 0; | 263 | unsigned long long base = 0, size = 0; |
@@ -252,6 +271,16 @@ static void __init setup_crashkernel(unsigned long total, int *n) | |||
252 | base = kdump_find_rsvd_region(size, | 271 | base = kdump_find_rsvd_region(size, |
253 | rsvd_region, *n); | 272 | rsvd_region, *n); |
254 | } | 273 | } |
274 | |||
275 | if (!check_crashkernel_memory(base, size)) { | ||
276 | pr_warning("crashkernel: There would be kdump memory " | ||
277 | "at %ld GB but this is unusable because it " | ||
278 | "must\nbe below 4 GB. Change the memory " | ||
279 | "configuration of the machine.\n", | ||
280 | (unsigned long)(base >> 30)); | ||
281 | return; | ||
282 | } | ||
283 | |||
255 | if (base != ~0UL) { | 284 | if (base != ~0UL) { |
256 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " | 285 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " |
257 | "for crashkernel (System RAM: %ldMB)\n", | 286 | "for crashkernel (System RAM: %ldMB)\n", |