1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-15 15:06:42 +00:00

Detect hypervisors early. We used to set lower hz on hypervisors by default

but it was broken since r273800 (and r278522, its MFC to stable/10) because
identify_cpu() is called too late, i.e., after init_param1().

MFC after:	3 days
This commit is contained in:
Jung-uk Kim 2017-08-05 06:56:46 +00:00
parent 11b5e0cd9c
commit 0105034487
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=322076
4 changed files with 6 additions and 2 deletions

View File

@ -1537,6 +1537,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
kmdp = init_ops.parse_preload_data(modulep);
identify_hypervisor();
/* Init basic tunables, hz etc */
init_param1();

View File

@ -2185,6 +2185,8 @@ init386(int first)
else
init_static_kenv(NULL, 0);
identify_hypervisor();
/* Init basic tunables, hz etc */
init_param1();

View File

@ -116,6 +116,7 @@ void cpu_setregs(void);
void dump_add_page(vm_paddr_t);
void dump_drop_page(vm_paddr_t);
void identify_cpu(void);
void identify_hypervisor(void);
void initializecpu(void);
void initializecpucache(void);
bool fix_cpuid(void);

View File

@ -1252,7 +1252,7 @@ static const char *const vm_pnames[] = {
NULL
};
static void
void
identify_hypervisor(void)
{
u_int regs[4];
@ -1403,7 +1403,6 @@ identify_cpu(void)
cpu_feature2 = regs[2];
#endif
identify_hypervisor();
cpu_vendor_id = find_cpu_vendor_id();
if (fix_cpuid()) {