-/* $OpenBSD: autoconf.c,v 1.55 2022/09/08 10:22:05 kn Exp $ */
+/* $OpenBSD: autoconf.c,v 1.56 2024/05/14 01:42:07 guenther Exp $ */
/* $NetBSD: autoconf.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
extern int amd64_has_xcrypt;
void pclmul_setup(void);
-extern int amd64_has_pclmul;
-
void aesni_setup(void);
-extern int amd64_has_aesni;
#endif
void
if (amd64_has_xcrypt)
viac3_crypto_setup();
- if (amd64_has_pclmul)
+ if (cpu_ecxfeature & CPUIDECX_PCLMUL)
pclmul_setup();
- if (amd64_has_aesni)
+ if (cpu_ecxfeature & CPUIDECX_AES)
aesni_setup();
#endif
}
-/* $OpenBSD: cpu.c,v 1.187 2024/05/12 16:49:38 guenther Exp $ */
+/* $OpenBSD: cpu.c,v 1.188 2024/05/14 01:42:07 guenther Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
char cpu_vendor[16] = { 0 }; /* CPU0's cpuid(0).e[bdc]x, \0 */
int cpu_id = 0; /* cpuid(1).eax */
int cpu_ebxfeature = 0; /* cpuid(1).ebx */
-int cpu_ecxfeature = 0; /* cpuid(1).ecx */
+int cpu_ecxfeature = 0; /* INTERSECTION(cpuid(1).ecx) */
int cpu_feature = 0; /* cpuid(1).edx */
int ecpu_ecxfeature = 0; /* cpuid(0x80000001).ecx */
int cpu_meltdown = 0;
-/* $OpenBSD: identcpu.c,v 1.142 2024/05/12 16:49:38 guenther Exp $ */
+/* $OpenBSD: identcpu.c,v 1.143 2024/05/14 01:42:07 guenther Exp $ */
/* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*
int cpuspeed;
int amd64_has_xcrypt;
-#ifdef CRYPTO
-int amd64_has_pclmul;
-int amd64_has_aesni;
-#endif
int has_rdrand;
int has_rdseed;
/* Let cpu_feature be the common bits */
cpu_feature &= ci->ci_feature_flags |
(ci->ci_feature_eflags & CPUID_NXE);
+ cpu_ecxfeature &= curcpu_1_ecx;
}
/* cflush cacheline size is equal to bits 15-8 of ebx * 8 */
ci->ci_cflushsz = ((cflushsz >> 8) & 0xff) * 8;
}
#endif
-#ifdef CRYPTO
- if (CPU_IS_PRIMARY(ci)) {
- if (cpu_ecxfeature & CPUIDECX_PCLMUL)
- amd64_has_pclmul = 1;
-
- if (cpu_ecxfeature & CPUIDECX_AES)
- amd64_has_aesni = 1;
- }
-#endif
-
if (CPU_IS_PRIMARY(ci) && ci->ci_vendor == CPUV_VIA) {
ci->cpu_setup = via_nano_setup;
#ifndef SMALL_KERNEL