Skip to content

Commit 1b588a6

Browse files
committed
Merged PR 8129085: Disable AVX2 in Windows boot lib for AMD64
We're investigating boot failures in the lab (see bugs #42178021, #42182776) but so far we've made limited progress because the boot debugger unexpectedly disconnects, and we haven't been able to reproduce the issue locally. Our working theory is that recent SHA2 optimizations may have increased code size and/or stack usage beyond what the boot environment can accommodate. To confirm or exclude this diagnosis, this change disables AVX2 for AMD64 in the boot environment, which will remove the new SHA2 optimizations. Related work items: #42178021, #42182776
1 parent 00fbdcd commit 1b588a6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/env_windowsBootLib.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,14 @@ BlStatusError (
3030

3131
SYMCRYPT_CPU_FEATURES SYMCRYPT_CALL SymCryptCpuFeaturesNeverPresentEnvWindowsBootlibrary()
3232
{
33-
#if SYMCRYPT_CPU_X86
33+
#if SYMCRYPT_CPU_X86 | SYMCRYPT_CPU_AMD64
3434
//
35-
// We disable AVX2 for X86.
35+
// We disable AVX2 for X86 (including X86-64)
3636
// This reduces codesize for bootmgr on PCAT which is codesize-constrained,
3737
// and is simpler than creating a separate PCAT-bootlib SymCrypt environment.
38-
// We expect that very few AVX2-capable machines will boot x86, and x86 still has XMM-based parallel
39-
// hashing, so the performance loss is quite small.
40-
// We considered locking out AES-NI as well; that would reduce codesize, but slow down BitLocker boot on
41-
// x86 which is an important mobile scenario.
4238
//
4339
return SYMCRYPT_CPU_FEATURE_AVX2;
44-
#elif SYMCRYPT_CPU_ARM | SYMCRYPT_CPU_ARM64 | SYMCRYPT_CPU_AMD64
40+
#elif SYMCRYPT_CPU_ARM | SYMCRYPT_CPU_ARM64
4541
return 0;
4642
#endif
4743
}

0 commit comments

Comments
 (0)