Revert "x86/setup: don't remove E820_TYPE_RAM for pfn 0"

This reverts commit bde9cfa3afe4324ec251e4af80ebf9b7afaf7afe.

Changing the first memory page type from E820_TYPE_RESERVED to
E820_TYPE_RAM makes it a part of "System RAM" resource rather than a
reserved resource and this in turn causes devmem_is_allowed() to treat
is as area that can be accessed but it is filled with zeroes instead of
the actual data as previously.

The change in /dev/mem output causes lilo to fail as was reported at
slakware users forum, and probably other legacy applications will
experience similar problems.

Link: https://www.linuxquestions.org/questions/slackware-14/slackware-current-lilo-vesa-warnings-after-recent-updates-4175689617/#post6214439
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Mike Rapoport and committed by Linus Torvalds 5c279c4c 927002ed

Changed files
+11 -9
arch
x86
kernel
+11 -9
arch/x86/kernel/setup.c
··· 661 661 static void __init trim_bios_range(void) 662 662 { 663 663 /* 664 + * A special case is the first 4Kb of memory; 665 + * This is a BIOS owned area, not kernel ram, but generally 666 + * not listed as such in the E820 table. 667 + * 668 + * This typically reserves additional memory (64KiB by default) 669 + * since some BIOSes are known to corrupt low memory. See the 670 + * Kconfig help text for X86_RESERVE_LOW. 671 + */ 672 + e820__range_update(0, PAGE_SIZE, E820_TYPE_RAM, E820_TYPE_RESERVED); 673 + 674 + /* 664 675 * special case: Some BIOSes report the PC BIOS 665 676 * area (640Kb -> 1Mb) as RAM even though it is not. 666 677 * take them out. ··· 728 717 729 718 static void __init trim_low_memory_range(void) 730 719 { 731 - /* 732 - * A special case is the first 4Kb of memory; 733 - * This is a BIOS owned area, not kernel ram, but generally 734 - * not listed as such in the E820 table. 735 - * 736 - * This typically reserves additional memory (64KiB by default) 737 - * since some BIOSes are known to corrupt low memory. See the 738 - * Kconfig help text for X86_RESERVE_LOW. 739 - */ 740 720 memblock_reserve(0, ALIGN(reserve_low, PAGE_SIZE)); 741 721 } 742 722