summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2010-09-07 16:22:48 +0000
committermikeb <mikeb@openbsd.org>2010-09-07 16:22:48 +0000
commit5772cc21d5c224f129471e76d091f3e34975baec (patch)
tree9f79977d9c3321cc37ac06f9d776ff4f8a362be9
parentremove the powerhook code. All architectures now use the ca_activate tree (diff)
downloadwireguard-openbsd-5772cc21d5c224f129471e76d091f3e34975baec.tar.xz
wireguard-openbsd-5772cc21d5c224f129471e76d091f3e34975baec.zip
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.c8
-rw-r--r--sys/arch/amd64/amd64/identcpu.c6
-rw-r--r--sys/arch/amd64/conf/files.amd646
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