Re: [PATCH v2] x86: remove the BIOS memory corruption check feature

From: Luiz Capitulino

Date: Fri Oct 09 2026 - 16:17:09 EST




On 10/9/26 2:06 PM, Thorsten Blum wrote:
On Mon, Jul 20, 2026 at 04:41:05PM -0400, Luiz Capitulino wrote:
By default, the BIOS memory corruption check works by reserving the
first 64 KiB physical area from memblock, zeroing it and then scanning it
periodically.

However, this functionality has been broken since v5.13 by two commits:

- Commit a799c2bd29d1 ("x86/setup: Consolidate early memory reservations").
Moved trim_low_memory_range() into early_reserve_memory(), which runs
earlier in setup_arch(), causing the first 64 KiB to be reserved (when
CONFIG_X86_RESERVE_LOW=64) before setup_bios_corruption_check() runs

- Commit f1d4d47c5851 ("x86/setup: Always reserve the first 1M of RAM").
Hardcodes the reservation of the first 64 KiB early in
early_reserve_memory()

It might be possible to get this feature to work by allowing
setup_bios_corruption_check() to run first, but it's just not worth it
given that the kernel will never access this memory area anyways.

Signed-off-by: Luiz Capitulino <luizcap@xxxxxxxxxx>
---

Changelog
=========

v2
- Rebase against latest Linus tree (v7.2-rc4)
- Improve changelog

.../admin-guide/kernel-parameters.txt | 23 ---
arch/x86/Kconfig | 30 ---
arch/x86/configs/i386_defconfig | 1 -
arch/x86/configs/x86_64_defconfig | 1 -
arch/x86/include/asm/bios_ebda.h | 17 --
arch/x86/include/asm/setup.h | 1 -
arch/x86/kernel/Makefile | 2 -
arch/x86/kernel/check.c | 187 ------------------
arch/x86/kernel/setup.c | 4 -
9 files changed, 266 deletions(-)
delete mode 100644 arch/x86/kernel/check.c

Hi Luiz,

Hey,

v2 no longer applies to mainline - are you planning to rebase it for v3?

If we plan to merge it, I can :)

Regarding the changelog: did you consider that the check is only broken
for the default size? Booting with

memory_corruption_check=1 memory_corruption_check_size=256K

still works and I get:

check: Scanning 1 areas for low memory corruption
check: Scanning for low memory corruption every 60 seconds

Yes, but IIRC this won't reserve the first 64K and my understanding
is that checking the first 64K was the main point of the feature.