On Sun, Aug 21, 2022 at 02:16:10AM -0400, Daniel Dickman wrote:
> On Sun, 21 Aug 2022, Jonathan Gray wrote:
> 
> > removed from amd64 in locore.S 1.71 in 2015
> > the cpuid_level == -1 path can go in a later step
> 
> Can we also remove
>   375:extern const struct cpu_nocpuid_nameclass i386_nocpuid_cpus[];
> 
> from
>   include/cpu.h
> 
> ?

yes, that and struct cpu_nocpuid_nameclass can go

diff --git sys/arch/amd64/include/cpu.h sys/arch/amd64/include/cpu.h
index b8db48f2714..d8b7bc61ede 100644
--- sys/arch/amd64/include/cpu.h
+++ sys/arch/amd64/include/cpu.h
@@ -369,7 +369,6 @@ struct timeval;
 /* locore.S */
 extern int biosbasemem;
 extern int biosextmem;
-extern int cpu;
 extern int cpu_feature;
 extern int cpu_ebxfeature;
 extern int cpu_ecxfeature;
diff --git sys/arch/i386/i386/locore.s sys/arch/i386/i386/locore.s
index e0753e74267..dba6ce75b81 100644
--- sys/arch/i386/i386/locore.s
+++ sys/arch/i386/i386/locore.s
@@ -221,7 +221,7 @@ INTRENTRY_LABEL(label):     /* from kernel */       ; \
  */
        .data
 
-       .globl  _C_LABEL(cpu), _C_LABEL(cpu_id), _C_LABEL(cpu_vendor)
+       .globl  _C_LABEL(cpu_id), _C_LABEL(cpu_vendor)
        .globl  _C_LABEL(cpu_brandstr)
        .globl  _C_LABEL(cpuid_level)
        .globl  _C_LABEL(cpu_miscinfo)
@@ -266,7 +266,6 @@ _C_LABEL(lapic_tpr):
        .long   0
 #endif
 
-_C_LABEL(cpu):         .long   0       # are we 486, 586 or 686
 _C_LABEL(cpu_id):      .long   0       # saved from 'cpuid' instruction
 _C_LABEL(cpu_pae):     .long   0       # are we using PAE paging mode?
 _C_LABEL(cpu_miscinfo):        .long   0       # misc info (apic/brand id) 
from 'cpuid'
diff --git sys/arch/i386/i386/locore0.S sys/arch/i386/i386/locore0.S
index 8d03facc7b7..cba7edd53ba 100644
--- sys/arch/i386/i386/locore0.S
+++ sys/arch/i386/i386/locore0.S
@@ -131,7 +131,7 @@ start:      movw    $0x1234,0x472                   # warm 
boot
 
        testl   %eax,%eax
        jnz     .Ltry586
-.Lis486:       movl    $CPU_486,RELOC(_C_LABEL(cpu))
+.Lis486:
 
        jmp     2f
 
diff --git sys/arch/i386/i386/machdep.c sys/arch/i386/i386/machdep.c
index 36f3eef49e5..364132760fc 100644
--- sys/arch/i386/i386/machdep.c
+++ sys/arch/i386/i386/machdep.c
@@ -493,15 +493,6 @@ i386_init_pcb_tss(struct cpu_info *ci)
  */
 char   cpu_model[120];
 
-/*
- * Note: these are just the ones that may not have a cpuid instruction.
- * We deal with the rest in a different way.
- */
-const struct cpu_nocpuid_nameclass i386_nocpuid_cpus[] = {
-       { CPUVENDOR_INTEL, "Intel", "486DX",    CPUCLASS_486,
-               NULL},                          /* CPU_486   */
-};
-
 const char *classnames[] = {
        "",
        "486",
@@ -1672,18 +1663,13 @@ identifycpu(struct cpu_info *ci)
        extern uint32_t cpu_meltdown;
 
        if (cpuid_level == -1) {
-#ifdef DIAGNOSTIC
-               if (cpu < 0 || cpu >=
-                   (sizeof i386_nocpuid_cpus/sizeof(struct 
cpu_nocpuid_nameclass)))
-                       panic("unknown cpu type %d", cpu);
-#endif
-               name = i386_nocpuid_cpus[cpu].cpu_name;
-               vendor = i386_nocpuid_cpus[cpu].cpu_vendor;
-               vendorname = i386_nocpuid_cpus[cpu].cpu_vendorname;
+               name = "486DX";
+               vendor = CPUVENDOR_INTEL;
+               vendorname = "Intel";
                model = -1;
                step = -1;
-               class = i386_nocpuid_cpus[cpu].cpu_class;
-               ci->cpu_setup = i386_nocpuid_cpus[cpu].cpu_setup;
+               class = CPUCLASS_486;
+               ci->cpu_setup = NULL;
                modifier = "";
                token = "";
        } else {
diff --git sys/arch/i386/i386/mptramp.s sys/arch/i386/i386/mptramp.s
index a206cd6867b..a43ff971d05 100644
--- sys/arch/i386/i386/mptramp.s
+++ sys/arch/i386/i386/mptramp.s
@@ -98,7 +98,7 @@
                                MP_TRAMP_DATA
 #define _TRMP_DATA_OFFSET(a)  a = . - _C_LABEL(mp_tramp_data_start)
 
-       .globl  _C_LABEL(cpu),_C_LABEL(cpu_id),_C_LABEL(cpu_vendor)
+       .globl  _C_LABEL(cpu_id),_C_LABEL(cpu_vendor)
        .globl  _C_LABEL(cpuid_level),_C_LABEL(cpu_feature)
 
        .global _C_LABEL(cpu_spinup_trampoline)
diff --git sys/arch/i386/include/cpu.h sys/arch/i386/include/cpu.h
index 5f300710562..e0deec93fd6 100644
--- sys/arch/i386/include/cpu.h
+++ sys/arch/i386/include/cpu.h
@@ -317,14 +317,6 @@ void       calibrate_cyclecounter(void);
  */
 #include <machine/cputypes.h>
 
-struct cpu_nocpuid_nameclass {
-       int cpu_vendor;
-       const char *cpu_vendorname;
-       const char *cpu_name;
-       int cpu_class;
-       void (*cpu_setup)(struct cpu_info *);
-};
-
 struct cpu_cpuid_nameclass {
        const char *cpu_id;
        int cpu_vendor;
@@ -342,7 +334,6 @@ struct cpu_cpuid_feature {
 };
 
 /* locore.s */
-extern int cpu;
 extern int cpu_id;
 extern char cpu_vendor[]; /* note: NOT nul-terminated */
 extern char cpu_brandstr[];
@@ -372,7 +363,6 @@ extern void cpu_tsx_disable(struct cpu_info *);
 extern int cpu_apmhalt;
 extern int cpu_class;
 extern char cpu_model[];
-extern const struct cpu_nocpuid_nameclass i386_nocpuid_cpus[];
 extern const struct cpu_cpuid_nameclass i386_cpuid_cpus[];
 extern void (*cpu_idle_enter_fcn)(void);
 extern void (*cpu_idle_cycle_fcn)(void);
diff --git sys/arch/i386/include/cputypes.h sys/arch/i386/include/cputypes.h
index fd7c6b0bd3d..52f1f5318ec 100644
--- sys/arch/i386/include/cputypes.h
+++ sys/arch/i386/include/cputypes.h
@@ -36,12 +36,6 @@
 #define        CPUCLASS_586    2
 #define        CPUCLASS_686    3
 
-/*
- *     Kind of Processor.
- */
-
-#define        CPU_486         0       /* Intel 80486DX */
-
 /*
  * CPU vendors
  */

Reply via email to