260 * userland can issue rdtsc, and initialize the TSC_AUX value
261 * (the cpuid) for the rdtscp instruction on appropriately
262 * capable hardware.
263 */
264 if (is_x86_feature(x86_featureset, X86FSET_TSC))
265 setcr4(getcr4() & ~CR4_TSD);
266
267 if (is_x86_feature(x86_featureset, X86FSET_TSCP))
268 (void) wrmsr(MSR_AMD_TSCAUX, 0);
269
270 if (is_x86_feature(x86_featureset, X86FSET_DE))
271 setcr4(getcr4() | CR4_DE);
272 #endif /* __xpv */
273
274 /*
275 * initialize t0
276 */
277 t0.t_stk = (caddr_t)rp - MINFRAME;
278 t0.t_stkbase = t0stack;
279 t0.t_pri = maxclsyspri - 3;
280 t0.t_schedflag = TS_LOAD | TS_DONT_SWAP;
281 t0.t_procp = &p0;
282 t0.t_plockp = &p0lock.pl_lock;
283 t0.t_lwp = &lwp0;
284 t0.t_forw = &t0;
285 t0.t_back = &t0;
286 t0.t_next = &t0;
287 t0.t_prev = &t0;
288 t0.t_cpu = cpu[0];
289 t0.t_disp_queue = &cpu0_disp;
290 t0.t_bind_cpu = PBIND_NONE;
291 t0.t_bind_pset = PS_NONE;
292 t0.t_bindflag = (uchar_t)default_binding_mode;
293 t0.t_cpupart = &cp_default;
294 t0.t_clfuncs = &sys_classfuncs.thread;
295 t0.t_copyops = NULL;
296 THREAD_ONPROC(&t0, CPU);
297
298 lwp0.lwp_thread = &t0;
299 lwp0.lwp_regs = (void *)rp;
300 lwp0.lwp_procp = &p0;
|
260 * userland can issue rdtsc, and initialize the TSC_AUX value
261 * (the cpuid) for the rdtscp instruction on appropriately
262 * capable hardware.
263 */
264 if (is_x86_feature(x86_featureset, X86FSET_TSC))
265 setcr4(getcr4() & ~CR4_TSD);
266
267 if (is_x86_feature(x86_featureset, X86FSET_TSCP))
268 (void) wrmsr(MSR_AMD_TSCAUX, 0);
269
270 if (is_x86_feature(x86_featureset, X86FSET_DE))
271 setcr4(getcr4() | CR4_DE);
272 #endif /* __xpv */
273
274 /*
275 * initialize t0
276 */
277 t0.t_stk = (caddr_t)rp - MINFRAME;
278 t0.t_stkbase = t0stack;
279 t0.t_pri = maxclsyspri - 3;
280 t0.t_schedflag = 0;
281 t0.t_procp = &p0;
282 t0.t_plockp = &p0lock.pl_lock;
283 t0.t_lwp = &lwp0;
284 t0.t_forw = &t0;
285 t0.t_back = &t0;
286 t0.t_next = &t0;
287 t0.t_prev = &t0;
288 t0.t_cpu = cpu[0];
289 t0.t_disp_queue = &cpu0_disp;
290 t0.t_bind_cpu = PBIND_NONE;
291 t0.t_bind_pset = PS_NONE;
292 t0.t_bindflag = (uchar_t)default_binding_mode;
293 t0.t_cpupart = &cp_default;
294 t0.t_clfuncs = &sys_classfuncs.thread;
295 t0.t_copyops = NULL;
296 THREAD_ONPROC(&t0, CPU);
297
298 lwp0.lwp_thread = &t0;
299 lwp0.lwp_regs = (void *)rp;
300 lwp0.lwp_procp = &p0;
|