summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2017-05-10 12:36:36 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2017-05-10 12:36:36 +0000
commitaec20f83b238ebc5d0d9282c3b77635c5c5c420d (patch)
treed4d411de7a9afe0c3f6cd86f0c0f12a667a4bad8 /sys/arch/amd64
parentbff10b63d763049849335a386338347ff6351820 (diff)
The setting of the cpu feature flags for PCLMUL and AES-NI was guarded with
!SMALL_KERNEL and CRYPTO. Move it out of !SMALL_KERNEL to make use of these features on RAMDISK_CD. Fixes a performance regression in the installer introduced with the new aes implementation. In particular, it halves the time needed to extract baseXX.tgz and compXX.tgz on my T420. tweaks & ok mikeb
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/identcpu.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/arch/amd64/amd64/identcpu.c b/sys/arch/amd64/amd64/identcpu.c
index 204e62b0c82..cb8ac4f3492 100644
--- a/sys/arch/amd64/amd64/identcpu.c
+++ b/sys/arch/amd64/amd64/identcpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: identcpu.c,v 1.83 2017/04/14 01:02:28 mlarkin Exp $ */
+/* $OpenBSD: identcpu.c,v 1.84 2017/05/10 12:36:35 tb Exp $ */
/* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*
@@ -669,14 +669,6 @@ identifycpu(struct cpu_info *ci)
if (cpu_ecxfeature & CPUIDECX_EST)
setperf_setup = est_init;
-#ifdef CRYPTO
- if (cpu_ecxfeature & CPUIDECX_PCLMUL)
- amd64_has_pclmul = 1;
-
- if (cpu_ecxfeature & CPUIDECX_AES)
- amd64_has_aesni = 1;
-#endif
-
if (cpu_ecxfeature & CPUIDECX_RDRAND)
has_rdrand = 1;
@@ -702,7 +694,16 @@ identifycpu(struct cpu_info *ci)
sensor_attach(&ci->ci_sensordev, &ci->ci_sensor);
sensordev_install(&ci->ci_sensordev);
}
+#endif
+#ifdef CRYPTO
+ if (ci->ci_flags & CPUF_PRIMARY) {
+ if (cpu_ecxfeature & CPUIDECX_PCLMUL)
+ amd64_has_pclmul = 1;
+
+ if (cpu_ecxfeature & CPUIDECX_AES)
+ amd64_has_aesni = 1;
+ }
#endif
if (!strcmp(cpu_vendor, "AuthenticAMD"))