mirror of
https://github.com/memtest86plus/memtest86plus.git
synced 2026-08-26 13:17:12 -05:00
A recent change (commit e41655885) to the Fedora implementation of the GRUB "linux" command for EFI boot means it now attempts to make the loaded code section read-only, using the EFI_MEMORY_ATTRIBUTE_PROTOCOL. In our image the code section contains the combined .text and .data sections. Our startup code needs to write to the .data section before we can switch to our own page descriptor table, so globally disable write protection as soon as we return from efisetup(). Our page descriptor table makes all pages writable (we need to be able to write to memory to test it), so there's no need to reenable the write protection once we've made the switch. I have no UEFI firmware that implements the EFI_MEMORY_ATTRIBUTE_PROTOCOL, so this fix is not yet proven.