0526-x86-boot-Fix-kdump-cleanup-aborted-E820_PRAM-max_pfn.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From be7d40bc3716ddaaff3cc085f0bdd90b26b72aeb Mon Sep 17 00:00:00 2001
  2. From: Dan Williams <dan.j.williams@intel.com>
  3. Date: Wed, 21 Sep 2016 12:50:45 -0700
  4. Subject: [PATCH] x86/boot: Fix kdump, cleanup aborted E820_PRAM max_pfn
  5. manipulation
  6. commit 917db484dc6a69969d317b3e57add4208a8d9d42 upstream.
  7. In commit:
  8. ec776ef6bbe1 ("x86/mm: Add support for the non-standard protected e820 type")
  9. Christoph references the original patch I wrote implementing pmem support.
  10. The intent of the 'max_pfn' changes in that commit were to enable persistent
  11. memory ranges to be covered by the struct page memmap by default.
  12. However, that approach was abandoned when Christoph ported the patches [1], and
  13. that functionality has since been replaced by devm_memremap_pages().
  14. In the meantime, this max_pfn manipulation is confusing kdump [2] that
  15. assumes that everything covered by the max_pfn is "System RAM". This
  16. results in kdump hanging or crashing.
  17. [1]: https://lists.01.org/pipermail/linux-nvdimm/2015-March/000348.html
  18. [2]: https://bugzilla.redhat.com/show_bug.cgi?id=1351098
  19. So fix it.
  20. Reported-by: Zhang Yi <yizhan@redhat.com>
  21. Reported-by: Jeff Moyer <jmoyer@redhat.com>
  22. Tested-by: Zhang Yi <yizhan@redhat.com>
  23. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  24. Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
  25. Cc: Andrew Morton <akpm@linux-foundation.org>
  26. Cc: Boaz Harrosh <boaz@plexistor.com>
  27. Cc: Christoph Hellwig <hch@lst.de>
  28. Cc: Linus Torvalds <torvalds@linux-foundation.org>
  29. Cc: Peter Zijlstra <peterz@infradead.org>
  30. Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
  31. Cc: Thomas Gleixner <tglx@linutronix.de>
  32. Cc: linux-nvdimm@lists.01.org
  33. Fixes: ec776ef6bbe1 ("x86/mm: Add support for the non-standard protected e820 type")
  34. Link: http://lkml.kernel.org/r/147448744538.34910.11287693517367139607.stgit@dwillia2-desk3.amr.corp.intel.com
  35. Signed-off-by: Ingo Molnar <mingo@kernel.org>
  36. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  37. ---
  38. arch/x86/kernel/e820.c | 2 +-
  39. 1 file changed, 1 insertion(+), 1 deletion(-)
  40. --- a/arch/x86/kernel/e820.c
  41. +++ b/arch/x86/kernel/e820.c
  42. @@ -348,7 +348,7 @@ int __init sanitize_e820_map(struct e820
  43. * continue building up new bios map based on this
  44. * information
  45. */
  46. - if (current_type != last_type || current_type == E820_PRAM) {
  47. + if (current_type != last_type) {
  48. if (last_type != 0) {
  49. new_bios[new_bios_entry].size =
  50. change_point[chgidx]->addr - last_addr;