From b53247cf58d51e5bc77764a90d41f902ad67ed0e Mon Sep 17 00:00:00 2001 From: "Thordur I. Bjornsson" Date: Thu, 1 Jul 2010 00:24:28 +0000 Subject: Add things to enable aesni either ifdef'ed or commented out to ease testing. Note: aesni is not in a usable state yet! OK deraadt@ --- sys/arch/amd64/amd64/autoconf.c | 10 +++++++++- sys/arch/amd64/amd64/identcpu.c | 13 ++++++++++++- sys/arch/amd64/conf/files.amd64 | 4 +++- 3 files changed, 24 insertions(+), 3 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/amd64/amd64/autoconf.c b/sys/arch/amd64/amd64/autoconf.c index f98e3cdb596..3f2ab670cc3 100644 --- a/sys/arch/amd64/amd64/autoconf.c +++ b/sys/arch/amd64/amd64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.33 2010/06/28 22:20:12 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.34 2010/07/01 00:24:27 thib Exp $ */ /* $NetBSD: autoconf.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */ /*- @@ -100,6 +100,10 @@ void viac3_rnd(void *); #ifdef CRYPTO void viac3_crypto_setup(void); extern int amd64_has_xcrypt; +#ifdef notyet +void aesni_setup(void); +extern int amd64_has_aesni; +#endif #endif /* @@ -148,6 +152,10 @@ cpu_configure(void) */ if (amd64_has_xcrypt) viac3_crypto_setup(); +#ifdef notyet + if (amd64_has_aesni) + aesni_setup(); +#endif #endif } diff --git a/sys/arch/amd64/amd64/identcpu.c b/sys/arch/amd64/amd64/identcpu.c index cd6189bde29..81d982077d3 100644 --- a/sys/arch/amd64/amd64/identcpu.c +++ b/sys/arch/amd64/amd64/identcpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: identcpu.c,v 1.28 2010/06/26 23:24:43 guenther Exp $ */ +/* $OpenBSD: identcpu.c,v 1.29 2010/07/01 00:24:27 thib Exp $ */ /* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */ /* @@ -47,7 +47,13 @@ /* sysctl wants this. */ char cpu_model[48]; int cpuspeed; + int amd64_has_xcrypt; +#ifdef CRYPTO +#ifdef notyet +int amd64_has_aesni; +#endif +#endif const struct { u_int32_t bit; @@ -366,6 +372,11 @@ identifycpu(struct cpu_info *ci) setperf_setup = est_init; } +#ifdef notyet + if (cpu_ecxfeature & CPUIDECX_AES) + amd64_has_aesni = 1; +#endif + if (!strncmp(cpu_model, "Intel", 5)) { u_int32_t cflushsz; diff --git a/sys/arch/amd64/conf/files.amd64 b/sys/arch/amd64/conf/files.amd64 index aab94de6b63..307297fa0b4 100644 --- a/sys/arch/amd64/conf/files.amd64 +++ b/sys/arch/amd64/conf/files.amd64 @@ -1,4 +1,4 @@ -# $OpenBSD: files.amd64,v 1.56 2010/05/24 23:19:21 deraadt Exp $ +# $OpenBSD: files.amd64,v 1.57 2010/07/01 00:24:27 thib Exp $ maxpartitions 16 maxusers 2 16 128 @@ -10,6 +10,8 @@ file arch/amd64/amd64/gdt.c file arch/amd64/amd64/machdep.c file arch/amd64/amd64/identcpu.c file arch/amd64/amd64/via.c +#file arch/amd64/amd64/aes_intel.S crypto +#file arch/amd64/amd64/aesni.c crypto file arch/amd64/amd64/amd64errata.c file arch/amd64/amd64/mem.c file arch/amd64/amd64/amd64_mem.c mtrr -- cgit v1.2.3