summaryrefslogtreecommitdiffstats
path: root/src/config/defaults/efi.h
diff options
context:
space:
mode:
authorMichael Brown2020-07-07 14:49:17 +0200
committerMichael Brown2020-07-07 15:08:05 +0200
commit98d49e460a27f74212aab2d6b5eef1143c7a8e37 (patch)
treec9cb594bafd7066935e8965bda84c659e2e12c20 /src/config/defaults/efi.h
parent[libc] Provide an unoptimised generic_memcpy_reverse() (diff)
downloadipxe-98d49e460a27f74212aab2d6b5eef1143c7a8e37.tar.gz
ipxe-98d49e460a27f74212aab2d6b5eef1143c7a8e37.tar.xz
ipxe-98d49e460a27f74212aab2d6b5eef1143c7a8e37.zip
[efi] Avoid setting direction flag on EFI platforms
The only remaining use case in iPXE for the CPU direction flag is in __memcpy_reverse() where it is set to allow the use of "rep movsb" to perform the memory copy. This matches the equivalent functionality in the EDK2 codebase, which has functions such as InternalMemCopyMem that also temporarily set the direction flag in order to use "rep movsb". As noted in commit d2fb317 ("[crypto] Avoid temporarily setting direction flag in bigint_is_geq()"), some UEFI implementations are known to have buggy interrupt handlers that may reboot the machine if a timer interrupt happens to occur while the direction flag is set. Work around these buggy UEFI implementations by using the (unoptimised) generic_memcpy_reverse() on i386 or x86_64 UEFI platforms. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/config/defaults/efi.h')
-rw-r--r--src/config/defaults/efi.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/config/defaults/efi.h b/src/config/defaults/efi.h
index 53a7a7b4..e707dfa6 100644
--- a/src/config/defaults/efi.h
+++ b/src/config/defaults/efi.h
@@ -46,6 +46,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define IOAPI_X86
#define NAP_EFIX86
#define CPUID_CMD /* x86 CPU feature detection command */
+#define UNSAFE_STD /* Avoid setting direction flag */
#endif
#if defined ( __arm__ ) || defined ( __aarch64__ )