diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2010-09-07 16:22:49 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2010-09-07 16:22:49 +0000 |
commit | 52852ea3823529a18252b1e2e3bcaea2a0ba8fa0 (patch) | |
tree | cd300c5d71ce04fdac1c2562bcf20ab9edbb83e3 | |
parent | 0909b33ee356b8b24e8cfd8ef9abfcce75eac449 (diff) |
enable aesni.
that means that all users running ipsec on amd64 with 'aes'
cpu flag will have aes encryption accelerated in cbc and ctr
modes for all three key sizes: 128, 192 and 256.
for debug purposed a number of operations performed by the
driver is visible throught the pstat(8) utility:
pstat -d u aesni_ops
note that you need to run config(8) to hook up new files.
ok kettenis thib deraadt
-rw-r--r-- | sys/arch/amd64/amd64/autoconf.c | 8 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/identcpu.c | 6 | ||||
-rw-r--r-- | sys/arch/amd64/conf/files.amd64 | 6 |
3 files changed, 7 insertions, 13 deletions
diff --git a/sys/arch/amd64/amd64/autoconf.c b/sys/arch/amd64/amd64/autoconf.c index 5c8804ac56c..e4d9e121be0 100644 --- a/sys/arch/amd64/amd64/autoconf.c +++ b/sys/arch/amd64/amd64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.35 2010/07/25 21:43:38 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.36 2010/09/07 16:22:48 mikeb Exp $ */ /* $NetBSD: autoconf.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */ /*- @@ -100,11 +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 /* * Determine i/o configuration for a machine. @@ -150,11 +149,10 @@ cpu_configure(void) */ if (amd64_has_xcrypt) viac3_crypto_setup(); -#ifdef notyet + if (amd64_has_aesni) aesni_setup(); #endif -#endif } void diff --git a/sys/arch/amd64/amd64/identcpu.c b/sys/arch/amd64/amd64/identcpu.c index 81d982077d3..8abd2eae8c4 100644 --- a/sys/arch/amd64/amd64/identcpu.c +++ b/sys/arch/amd64/amd64/identcpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: identcpu.c,v 1.29 2010/07/01 00:24:27 thib Exp $ */ +/* $OpenBSD: identcpu.c,v 1.30 2010/09/07 16:22:48 mikeb Exp $ */ /* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */ /* @@ -50,10 +50,8 @@ int cpuspeed; int amd64_has_xcrypt; #ifdef CRYPTO -#ifdef notyet int amd64_has_aesni; #endif -#endif const struct { u_int32_t bit; @@ -372,10 +370,8 @@ 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 307297fa0b4..519b24be01e 100644 --- a/sys/arch/amd64/conf/files.amd64 +++ b/sys/arch/amd64/conf/files.amd64 @@ -1,4 +1,4 @@ -# $OpenBSD: files.amd64,v 1.57 2010/07/01 00:24:27 thib Exp $ +# $OpenBSD: files.amd64,v 1.58 2010/09/07 16:22:48 mikeb Exp $ maxpartitions 16 maxusers 2 16 128 @@ -10,8 +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/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 |