-/* $OpenBSD: cacheinfo.c,v 1.10 2022/06/28 12:11:41 jsg Exp $ */
+/* $OpenBSD: cacheinfo.c,v 1.11 2022/07/12 04:46:00 jsg Exp $ */
/*
* Copyright (c) 2022 Jonathan Gray <jsg@openbsd.org>
#include <machine/cpu.h>
#include <machine/specialreg.h>
-void
-amd_cpu_cacheinfo(struct cpu_info *ci)
-{
- u_int eax, ebx, ecx, edx;
-
- /* used by vmm */
-
- if (ci->ci_pnfeatset >= 0x80000005) {
- CPUID(0x80000005, eax, ebx, ecx, edx);
- ci->ci_amdcacheinfo[0] = eax;
- ci->ci_amdcacheinfo[1] = ebx;
- ci->ci_amdcacheinfo[2] = ecx;
- ci->ci_amdcacheinfo[3] = edx;
- }
-
- if (ci->ci_pnfeatset >= 0x80000006) {
- CPUID(0x80000006, eax, ebx, ecx, edx);
- ci->ci_extcacheinfo[0] = eax;
- ci->ci_extcacheinfo[1] = ebx;
- ci->ci_extcacheinfo[2] = ecx;
- ci->ci_extcacheinfo[3] = edx;
- }
-}
-
void
amd64_print_l1_cacheinfo(struct cpu_info *ci)
{
-/* $OpenBSD: identcpu.c,v 1.124 2022/04/26 10:48:20 claudio Exp $ */
+/* $OpenBSD: identcpu.c,v 1.125 2022/07/12 04:46:00 jsg Exp $ */
/* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*
freq = cpu_freq(ci);
- amd_cpu_cacheinfo(ci);
-
printf("%s: %s", ci->ci_dev->dv_xname, mycpu_model);
if (freq != 0)
-/* $OpenBSD: vmm.c,v 1.316 2022/06/30 13:17:58 dv Exp $ */
+/* $OpenBSD: vmm.c,v 1.317 2022/07/12 04:46:00 jsg Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
*rdx = curcpu()->ci_brand[11];
break;
case 0x80000005: /* Reserved (Intel), cacheinfo (AMD) */
- *rax = curcpu()->ci_amdcacheinfo[0];
- *rbx = curcpu()->ci_amdcacheinfo[1];
- *rcx = curcpu()->ci_amdcacheinfo[2];
- *rdx = curcpu()->ci_amdcacheinfo[3];
+ *rax = eax;
+ *rbx = ebx;
+ *rcx = ecx;
+ *rdx = edx;
break;
case 0x80000006: /* ext. cache info */
- *rax = curcpu()->ci_extcacheinfo[0];
- *rbx = curcpu()->ci_extcacheinfo[1];
- *rcx = curcpu()->ci_extcacheinfo[2];
- *rdx = curcpu()->ci_extcacheinfo[3];
+ *rax = eax;
+ *rbx = ebx;
+ *rcx = ecx;
+ *rdx = edx;
break;
case 0x80000007: /* apmi */
*rax = eax;
-/* $OpenBSD: cpu.h,v 1.144 2022/06/28 12:11:41 jsg Exp $ */
+/* $OpenBSD: cpu.h,v 1.145 2022/07/12 04:46:00 jsg Exp $ */
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
/*-
u_int32_t ci_efeature_eax;
u_int32_t ci_efeature_ecx;
u_int32_t ci_brand[12];
- u_int32_t ci_amdcacheinfo[4];
- u_int32_t ci_extcacheinfo[4];
u_int32_t ci_signature;
u_int32_t ci_family;
u_int32_t ci_model;
extern u_int cpu_mwait_states;
/* cacheinfo.c */
-void amd_cpu_cacheinfo(struct cpu_info *);
void x86_print_cacheinfo(struct cpu_info *);
/* identcpu.c */