diff --git a/Eigen/src/Core/arch/AVX512/GemmKernel.h b/Eigen/src/Core/arch/AVX512/GemmKernel.h
index f089e695b..cb7cfdffc 100644
--- a/Eigen/src/Core/arch/AVX512/GemmKernel.h
+++ b/Eigen/src/Core/arch/AVX512/GemmKernel.h
@@ -7,8 +7,8 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#ifndef GEMM_KERNEL_H
-#define GEMM_KERNEL_H
+#ifndef EIGEN_CORE_ARCH_AVX512_GEMM_KERNEL_H
+#define EIGEN_CORE_ARCH_AVX512_GEMM_KERNEL_H
 
 #if EIGEN_COMP_MSVC
 #include <intrin.h>
@@ -21,7 +21,8 @@
 #include "../../InternalHeaderCheck.h"
 
 #if !defined(EIGEN_USE_AVX512_GEMM_KERNELS)
-#define EIGEN_USE_AVX512_GEMM_KERNELS 1
+// Disable new AVX512 kernels by default.
+#define EIGEN_USE_AVX512_GEMM_KERNELS 0
 #endif
 
 #define SECOND_FETCH (32)
@@ -1229,4 +1230,6 @@ EIGEN_ALWAYS_INLINE void gebp_kernel<Scalar, Scalar, Index, DataMapper, mr, 8, C
 }  // namespace internal
 }  // namespace Eigen
 
-#endif  // GEMM_KERNEL_H
+#undef SECOND_FETCH
+
+#endif  // EIGEN_CORE_ARCH_AVX512_GEMM_KERNEL_H
diff --git a/Eigen/src/Core/arch/AVX512/TrsmKernel.h b/Eigen/src/Core/arch/AVX512/TrsmKernel.h
index 9dd3113cb..94f1f5a47 100644
--- a/Eigen/src/Core/arch/AVX512/TrsmKernel.h
+++ b/Eigen/src/Core/arch/AVX512/TrsmKernel.h
@@ -7,8 +7,8 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#ifndef EIGEN_TRSM_KERNEL_IMPL_H
-#define EIGEN_TRSM_KERNEL_IMPL_H
+#ifndef EIGEN_CORE_ARCH_AVX512_TRSM_KERNEL_H
+#define EIGEN_CORE_ARCH_AVX512_TRSM_KERNEL_H
 
 #include "../../InternalHeaderCheck.h"
 
@@ -1188,4 +1188,4 @@ EIGEN_DONT_INLINE void trsmKernelL<double, Index, Mode, false, TriStorageOrder,
 #endif  // EIGEN_USE_AVX512_TRSM_KERNELS
 }  // namespace internal
 }  // namespace Eigen
-#endif  // EIGEN_TRSM_KERNEL_IMPL_H
+#endif  // EIGEN_CORE_ARCH_AVX512_TRSM_KERNEL_H
diff --git a/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc b/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc
index 032937cfd..6b094244d 100644
--- a/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc
+++ b/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc
@@ -7,8 +7,8 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#ifndef EIGEN_UNROLLS_IMPL_H
-#define EIGEN_UNROLLS_IMPL_H
+#ifndef EIGEN_CORE_ARCH_AVX512_TRSM_UNROLLS_H
+#define EIGEN_CORE_ARCH_AVX512_TRSM_UNROLLS_H
 
 template <bool isARowMajor = true>
 static EIGEN_ALWAYS_INLINE int64_t idA(int64_t i, int64_t j, int64_t LDA) {
@@ -1209,4 +1209,4 @@ class gemm {
 };
 }  // namespace unrolls
 
-#endif  // EIGEN_UNROLLS_IMPL_H
+#endif  // EIGEN_CORE_ARCH_AVX512_TRSM_UNROLLS_H