MFC: r322323

Split identify_cpu() into two functions for amd64 as we do for i386.  This
fixes a regression introduced in r322205.

Approved by:	re (marius)
This commit is contained in:
Jung-uk Kim 2017-08-14 23:46:10 +00:00
parent af0b4ce6b2
commit f1e0e91693
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=322523
3 changed files with 17 additions and 14 deletions

View File

@ -1853,6 +1853,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t);
#endif
identify_cpu();
identify_hypervisor();
/* Init basic tunables, hz etc */
@ -1950,7 +1951,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
MODINFO_METADATA | MODINFOMD_EFI_MAP) != NULL)
vty_set_preferred(VTY_VT);
identify_cpu(); /* Final stage of CPU initialization */
finishidentcpu(); /* Final stage of CPU initialization */
initializecpu(); /* Initialize CPU registers */
initializecpucache();

View File

@ -119,6 +119,7 @@ void fsbase_load_fault(void) __asm(__STRING(fsbase_load_fault));
void gsbase_load_fault(void) __asm(__STRING(gsbase_load_fault));
void dump_add_page(vm_paddr_t);
void dump_drop_page(vm_paddr_t);
void finishidentcpu(void);
void identify_cpu(void);
void identify_hypervisor(void);
void initializecpu(void);

View File

@ -1346,23 +1346,12 @@ fix_cpuid(void)
return (false);
}
/*
* Final stage of CPU identification.
*/
#ifdef __i386__
void
finishidentcpu(void)
#else
#ifdef __amd64__
void
identify_cpu(void)
#endif
{
u_int regs[4], cpu_stdext_disable;
#ifdef __i386__
u_char ccr3;
#endif
u_int regs[4];
#ifdef __amd64__
do_cpuid(0, regs);
cpu_high = regs[0];
((u_int *)&cpu_vendor)[0] = regs[1];
@ -1375,6 +1364,18 @@ identify_cpu(void)
cpu_procinfo = regs[1];
cpu_feature = regs[3];
cpu_feature2 = regs[2];
}
#endif
/*
* Final stage of CPU identification.
*/
void
finishidentcpu(void)
{
u_int regs[4], cpu_stdext_disable;
#ifdef __i386__
u_char ccr3;
#endif
cpu_vendor_id = find_cpu_vendor_id();