10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
24 */
25 /*
26 * Copyright (c) 2010, Intel Corporation.
27 * All rights reserved.
28 */
29 /*
30 * Copyright 2019 Joyent, Inc.
31 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
32 * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
33 */
34
35 #include <sys/types.h>
36 #include <sys/thread.h>
37 #include <sys/cpuvar.h>
38 #include <sys/cpu.h>
39 #include <sys/t_lock.h>
40 #include <sys/param.h>
41 #include <sys/proc.h>
42 #include <sys/disp.h>
43 #include <sys/class.h>
44 #include <sys/cmn_err.h>
45 #include <sys/debug.h>
46 #include <sys/note.h>
47 #include <sys/asm_linkage.h>
48 #include <sys/x_call.h>
49 #include <sys/systm.h>
50 #include <sys/var.h>
1844 * Delegate initialization tasks, which need to access the cpu_lock,
1845 * to mp_start_cpu_common() because we can't acquire the cpu_lock here
1846 * during CPU DR operations.
1847 */
1848 mp_startup_signal(&procset_slave, cp->cpu_id);
1849 mp_startup_wait(&procset_master, cp->cpu_id);
1850 pg_cmt_cpu_startup(cp);
1851
1852 if (boot) {
1853 mutex_enter(&cpu_lock);
1854 cp->cpu_flags &= ~CPU_OFFLINE;
1855 cpu_enable_intr(cp);
1856 cpu_add_active(cp);
1857 mutex_exit(&cpu_lock);
1858 }
1859
1860 /* Enable interrupts */
1861 (void) spl0();
1862
1863 /*
1864 * Fill out cpu_ucode_info. Update microcode if necessary.
1865 */
1866 ucode_check(cp);
1867 cpuid_pass_ucode(cp, new_x86_featureset);
1868
1869 /*
1870 * Do a sanity check to make sure this new CPU is a sane thing
1871 * to add to the collection of processors running this system.
1872 *
1873 * XXX Clearly this needs to get more sophisticated, if x86
1874 * systems start to get built out of heterogenous CPUs; as is
1875 * likely to happen once the number of processors in a configuration
1876 * gets large enough.
1877 */
1878 if (compare_x86_featureset(x86_featureset, new_x86_featureset) ==
1879 B_FALSE) {
1880 cmn_err(CE_CONT, "cpu%d: featureset\n", cp->cpu_id);
1881 print_x86_featureset(new_x86_featureset);
1882 cmn_err(CE_WARN, "cpu%d feature mismatch", cp->cpu_id);
1883 }
1884
|
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
24 */
25 /*
26 * Copyright (c) 2010, Intel Corporation.
27 * All rights reserved.
28 */
29 /*
30 * Copyright 2020 Joyent, Inc.
31 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
32 * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
33 */
34
35 #include <sys/types.h>
36 #include <sys/thread.h>
37 #include <sys/cpuvar.h>
38 #include <sys/cpu.h>
39 #include <sys/t_lock.h>
40 #include <sys/param.h>
41 #include <sys/proc.h>
42 #include <sys/disp.h>
43 #include <sys/class.h>
44 #include <sys/cmn_err.h>
45 #include <sys/debug.h>
46 #include <sys/note.h>
47 #include <sys/asm_linkage.h>
48 #include <sys/x_call.h>
49 #include <sys/systm.h>
50 #include <sys/var.h>
1844 * Delegate initialization tasks, which need to access the cpu_lock,
1845 * to mp_start_cpu_common() because we can't acquire the cpu_lock here
1846 * during CPU DR operations.
1847 */
1848 mp_startup_signal(&procset_slave, cp->cpu_id);
1849 mp_startup_wait(&procset_master, cp->cpu_id);
1850 pg_cmt_cpu_startup(cp);
1851
1852 if (boot) {
1853 mutex_enter(&cpu_lock);
1854 cp->cpu_flags &= ~CPU_OFFLINE;
1855 cpu_enable_intr(cp);
1856 cpu_add_active(cp);
1857 mutex_exit(&cpu_lock);
1858 }
1859
1860 /* Enable interrupts */
1861 (void) spl0();
1862
1863 /*
1864 * Fill out cpu_ucode_info. Update microcode if necessary. Note that
1865 * this is done after pass1 on the boot CPU, but it needs to be later on
1866 * for the other CPUs.
1867 */
1868 ucode_check(cp);
1869 cpuid_pass_ucode(cp, new_x86_featureset);
1870
1871 /*
1872 * Do a sanity check to make sure this new CPU is a sane thing
1873 * to add to the collection of processors running this system.
1874 *
1875 * XXX Clearly this needs to get more sophisticated, if x86
1876 * systems start to get built out of heterogenous CPUs; as is
1877 * likely to happen once the number of processors in a configuration
1878 * gets large enough.
1879 */
1880 if (compare_x86_featureset(x86_featureset, new_x86_featureset) ==
1881 B_FALSE) {
1882 cmn_err(CE_CONT, "cpu%d: featureset\n", cp->cpu_id);
1883 print_x86_featureset(new_x86_featureset);
1884 cmn_err(CE_WARN, "cpu%d feature mismatch", cp->cpu_id);
1885 }
1886
|