From: jsg Date: Tue, 12 Jul 2022 04:46:00 +0000 (+0000) Subject: remove cache parts of struct cpu_info only vmm used X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c59e3f57905592841d1f48d6162d96d765acb726;p=openbsd remove cache parts of struct cpu_info only vmm used suggested by and ok mlarkin@ --- diff --git a/sys/arch/amd64/amd64/cacheinfo.c b/sys/arch/amd64/amd64/cacheinfo.c index 0fde19539cc..6996d6f27d8 100644 --- a/sys/arch/amd64/amd64/cacheinfo.c +++ b/sys/arch/amd64/amd64/cacheinfo.c @@ -1,4 +1,4 @@ -/* $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 @@ -22,30 +22,6 @@ #include #include -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) { diff --git a/sys/arch/amd64/amd64/identcpu.c b/sys/arch/amd64/amd64/identcpu.c index 158f4c42536..e633f932a65 100644 --- a/sys/arch/amd64/amd64/identcpu.c +++ b/sys/arch/amd64/amd64/identcpu.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -605,8 +605,6 @@ identifycpu(struct cpu_info *ci) freq = cpu_freq(ci); - amd_cpu_cacheinfo(ci); - printf("%s: %s", ci->ci_dev->dv_xname, mycpu_model); if (freq != 0) diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c index f790f5a73f2..e813d0630a6 100644 --- a/sys/arch/amd64/amd64/vmm.c +++ b/sys/arch/amd64/amd64/vmm.c @@ -1,4 +1,4 @@ -/* $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 * @@ -7229,16 +7229,16 @@ vmm_handle_cpuid(struct vcpu *vcpu) *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; diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index e4e9b981df8..6916915a446 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $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 $ */ /*- @@ -150,8 +150,6 @@ struct cpu_info { 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; @@ -387,7 +385,6 @@ extern u_int cpu_mwait_size; extern u_int cpu_mwait_states; /* cacheinfo.c */ -void amd_cpu_cacheinfo(struct cpu_info *); void x86_print_cacheinfo(struct cpu_info *); /* identcpu.c */