1e4b8688Cheng Sean Ye/*
2e4b8688Cheng Sean Ye * CDDL HEADER START
3e4b8688Cheng Sean Ye *
4e4b8688Cheng Sean Ye * The contents of this file are subject to the terms of the
5e4b8688Cheng Sean Ye * Common Development and Distribution License (the "License").
6e4b8688Cheng Sean Ye * You may not use this file except in compliance with the License.
7e4b8688Cheng Sean Ye *
8e4b8688Cheng Sean Ye * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e4b8688Cheng Sean Ye * or http://www.opensolaris.org/os/licensing.
10e4b8688Cheng Sean Ye * See the License for the specific language governing permissions
11e4b8688Cheng Sean Ye * and limitations under the License.
12e4b8688Cheng Sean Ye *
13e4b8688Cheng Sean Ye * When distributing Covered Code, include this CDDL HEADER in each
14e4b8688Cheng Sean Ye * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15e4b8688Cheng Sean Ye * If applicable, add the following below this CDDL HEADER, with the
16e4b8688Cheng Sean Ye * fields enclosed by brackets "[]" replaced with your own identifying
17e4b8688Cheng Sean Ye * information: Portions Copyright [yyyy] [name of copyright owner]
18e4b8688Cheng Sean Ye *
19e4b8688Cheng Sean Ye * CDDL HEADER END
20e4b8688Cheng Sean Ye */
21e4b8688Cheng Sean Ye
22e4b8688Cheng Sean Ye/*
2389e921dKuriakose Kuruvilla * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24e4b8688Cheng Sean Ye * Use is subject to license terms.
2579ec9daYuri Pankov *
2679ec9daYuri Pankov * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
27e4b8688Cheng Sean Ye */
28e4b8688Cheng Sean Ye
29e4b8688Cheng Sean Ye/*
3089e921dKuriakose Kuruvilla * Portions Copyright 2009 Advanced Micro Devices, Inc.
3189e921dKuriakose Kuruvilla */
3289e921dKuriakose Kuruvilla
3389e921dKuriakose Kuruvilla/*
347932179Jens Elkner * Copyright 2012 Jens Elkner <jel+illumos@cs.uni-magdeburg.de>
357932179Jens Elkner * Copyright 2012 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
362ce06f3Robert Mustacchi * Copyright 2018, Joyent, Inc.
377932179Jens Elkner */
387932179Jens Elkner
397932179Jens Elkner/*
40e4b8688Cheng Sean Ye * Support functions that interpret CPUID and similar information.
41e4b8688Cheng Sean Ye * These should not be used from anywhere other than cpuid.c and
42e4b8688Cheng Sean Ye * cmi_hw.c - as such we will not list them in any header file
43e4b8688Cheng Sean Ye * such as x86_archext.h.
44e4b8688Cheng Sean Ye *
45e4b8688Cheng Sean Ye * In cpuid.c we process CPUID information for each cpu_t instance
46e4b8688Cheng Sean Ye * we're presented with, and stash this raw information and material
47e4b8688Cheng Sean Ye * derived from it in per-cpu_t structures.
48e4b8688Cheng Sean Ye *
49e4b8688Cheng Sean Ye * If we are virtualized then the CPUID information derived from CPUID
50e4b8688Cheng Sean Ye * instructions executed in the guest is based on whatever the hypervisor
51e4b8688Cheng Sean Ye * wanted to make things look like, and the cpu_t are not necessarily in 1:1
52e4b8688Cheng Sean Ye * or fixed correspondence with real processor execution resources.  In cmi_hw.c
53e4b8688Cheng Sean Ye * we are interested in the native properties of a processor - for fault
54e4b8688Cheng Sean Ye * management (and potentially other, such as power management) purposes;
55e4b8688Cheng Sean Ye * it will tunnel through to real hardware information, and use the
56e4b8688Cheng Sean Ye * functionality provided in this file to process it.
57e4b8688Cheng Sean Ye */
58e4b8688Cheng Sean Ye
59e4b8688Cheng Sean Ye#include <sys/types.h>
60e4b8688Cheng Sean Ye#include <sys/systm.h>
6189e921dKuriakose Kuruvilla#include <sys/bitmap.h>
62e4b8688Cheng Sean Ye#include <sys/x86_archext.h>
6389e921dKuriakose Kuruvilla#include <sys/pci_cfgspace.h>
6489e921dKuriakose Kuruvilla#ifdef __xpv
6589e921dKuriakose Kuruvilla#include <sys/hypervisor.h>
6689e921dKuriakose Kuruvilla#endif
67e4b8688Cheng Sean Ye
68e4b8688Cheng Sean Ye/*
6989e921dKuriakose Kuruvilla * AMD socket types.
70e4b8688Cheng Sean Ye * First index :
71e4b8688Cheng Sean Ye *		0 for family 0xf, revs B thru E
72e4b8688Cheng Sean Ye *		1 for family 0xf, revs F and G
7389e921dKuriakose Kuruvilla *		2 for family 0x10
7489e921dKuriakose Kuruvilla *		3 for family 0x11
757932179Jens Elkner *		4 for family 0x12
767932179Jens Elkner *		5 for family 0x14
777932179Jens Elkner *		6 for family 0x15, models 00 - 0f
787932179Jens Elkner *		7 for family 0x15, models 10 - 1f
792ce06f3Robert Mustacchi *		8 for family 0x15, models 30 - 3f
802ce06f3Robert Mustacchi *		9 for family 0x15, models 60 - 6f
812ce06f3Robert Mustacchi *		10 for family 0x15, models 70 - 7f
822ce06f3Robert Mustacchi *		11 for family 0x16, models 00 - 0f
832ce06f3Robert Mustacchi *		12 for family 0x16, models 30 - 3f
842ce06f3Robert Mustacchi *		13 for family 0x17, models 00 - 0f
857932179Jens Elkner * Second index by (model & 0x3) for family 0fh,
867932179Jens Elkner * CPUID pkg bits (Fn8000_0001_EBX[31:28]) for later families.
87e4b8688Cheng Sean Ye */
882ce06f3Robert Mustacchistatic uint32_t amd_skts[14][8] = {
89e4b8688Cheng Sean Ye	/*
90e4b8688Cheng Sean Ye	 * Family 0xf revisions B through E
91e4b8688Cheng Sean Ye	 */
92e4b8688Cheng Sean Ye#define	A_SKTS_0			0
93e4b8688Cheng Sean Ye	{
94bd15239Srihari Venkatesan		X86_SOCKET_754,		/* 0b000 */
95bd15239Srihari Venkatesan		X86_SOCKET_940,		/* 0b001 */
96bd15239Srihari Venkatesan		X86_SOCKET_754,		/* 0b010 */
97bd15239Srihari Venkatesan		X86_SOCKET_939,		/* 0b011 */
98bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b100 */
99bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b101 */
100bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b110 */
101bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN	/* 0b111 */
102e4b8688Cheng Sean Ye	},
103e4b8688Cheng Sean Ye	/*
104e4b8688Cheng Sean Ye	 * Family 0xf revisions F and G
105e4b8688Cheng Sean Ye	 */
106e4b8688Cheng Sean Ye#define	A_SKTS_1			1
107e4b8688Cheng Sean Ye	{
108bd15239Srihari Venkatesan		X86_SOCKET_S1g1,	/* 0b000 */
109bd15239Srihari Venkatesan		X86_SOCKET_F1207,	/* 0b001 */
110bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b010 */
111bd15239Srihari Venkatesan		X86_SOCKET_AM2,		/* 0b011 */
112bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b100 */
113bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b101 */
114bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b110 */
115bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN	/* 0b111 */
116e4b8688Cheng Sean Ye	},
117e4b8688Cheng Sean Ye	/*
11889e921dKuriakose Kuruvilla	 * Family 0x10
119e4b8688Cheng Sean Ye	 */
120e4b8688Cheng Sean Ye#define	A_SKTS_2			2
121e4b8688Cheng Sean Ye	{
122bd15239Srihari Venkatesan		X86_SOCKET_F1207,	/* 0b000 */
1237932179Jens Elkner		X86_SOCKET_AM2R2,	/* 0b001 */
124bd15239Srihari Venkatesan		X86_SOCKET_S1g3,	/* 0b010 */
125bd15239Srihari Venkatesan		X86_SOCKET_G34,		/* 0b011 */
126bd15239Srihari Venkatesan		X86_SOCKET_ASB2,	/* 0b100 */
127bd15239Srihari Venkatesan		X86_SOCKET_C32,		/* 0b101 */
128bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b110 */
129bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN	/* 0b111 */
13089e921dKuriakose Kuruvilla	},
13189e921dKuriakose Kuruvilla
13289e921dKuriakose Kuruvilla	/*
13389e921dKuriakose Kuruvilla	 * Family 0x11
13489e921dKuriakose Kuruvilla	 */
13589e921dKuriakose Kuruvilla#define	A_SKTS_3			3
13689e921dKuriakose Kuruvilla	{
137bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b000 */
138bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b001 */
139bd15239Srihari Venkatesan		X86_SOCKET_S1g2,	/* 0b010 */
140bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b011 */
141bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b100 */
142bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b101 */
143bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN,	/* 0b110 */
144bd15239Srihari Venkatesan		X86_SOCKET_UNKNOWN	/* 0b111 */
1457932179Jens Elkner	},
1467932179Jens Elkner
1477932179Jens Elkner	/*
1487932179Jens Elkner	 * Family 0x12
1497932179Jens Elkner	 */
1507932179Jens Elkner#define	A_SKTS_4			4
1517932179Jens Elkner	{
1527932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b000 */
1537932179Jens Elkner		X86_SOCKET_FS1,		/* 0b001 */
1547932179Jens Elkner		X86_SOCKET_FM1,		/* 0b010 */
1557932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b011 */
1567932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b100 */
1577932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b101 */
1587932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b110 */
1597932179Jens Elkner		X86_SOCKET_UNKNOWN	/* 0b111 */
1607932179Jens Elkner	},
1617932179Jens Elkner
1627932179Jens Elkner	/*
1637932179Jens Elkner	 * Family 0x14
1647932179Jens Elkner	 */
1657932179Jens Elkner#define	A_SKTS_5			5
1667932179Jens Elkner	{
1677932179Jens Elkner		X86_SOCKET_FT1,		/* 0b000 */
1687932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b001 */
1697932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b010 */
1707932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b011 */
1717932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b100 */
1727932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b101 */
1737932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b110 */
1747932179Jens Elkner		X86_SOCKET_UNKNOWN	/* 0b111 */
1757932179Jens Elkner	},
1767932179Jens Elkner
1777932179Jens Elkner	/*
1787932179Jens Elkner	 * Family 0x15 models 00 - 0f
1797932179Jens Elkner	 */
1807932179Jens Elkner#define	A_SKTS_6			6
1817932179Jens Elkner	{
1827932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b000 */
1837932179Jens Elkner		X86_SOCKET_AM3R2,	/* 0b001 */
1847932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b010 */
1857932179Jens Elkner		X86_SOCKET_G34,		/* 0b011 */
1867932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b100 */
1877932179Jens Elkner		X86_SOCKET_C32,		/* 0b101 */
1887932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b110 */
1897932179Jens Elkner		X86_SOCKET_UNKNOWN	/* 0b111 */
1907932179Jens Elkner	},
1917932179Jens Elkner
1927932179Jens Elkner	/*
1937932179Jens Elkner	 * Family 0x15 models 10 - 1f
1947932179Jens Elkner	 */
1957932179Jens Elkner#define	A_SKTS_7			7
1967932179Jens Elkner	{
1977932179Jens Elkner		X86_SOCKET_FP2,		/* 0b000 */
1987932179Jens Elkner		X86_SOCKET_FS1R2,	/* 0b001 */
1997932179Jens Elkner		X86_SOCKET_FM2,		/* 0b010 */
2007932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b011 */
2017932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b100 */
2027932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b101 */
2037932179Jens Elkner		X86_SOCKET_UNKNOWN,	/* 0b110 */
2047932179Jens Elkner		X86_SOCKET_UNKNOWN	/* 0b111 */
2057932179Jens Elkner	},
2067932179Jens Elkner
2072ce06f3Robert Mustacchi	/*
2082ce06f3Robert Mustacchi	 * Family 0x15 models 30-3f
2092ce06f3Robert Mustacchi	 */
2102ce06f3Robert Mustacchi#define	A_SKTS_8			8
2112ce06f3Robert Mustacchi	{
2122ce06f3Robert Mustacchi		X86_SOCKET_FP3,		/* 0b000 */
2132ce06f3Robert Mustacchi		X86_SOCKET_FM2R2,	/* 0b001 */
2142ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b010 */
2152ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b011 */
2162ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b100 */
2172ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b101 */
2182ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b110 */
2192ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN	/* 0b111 */
2202ce06f3Robert Mustacchi	},
2212ce06f3Robert Mustacchi
2222ce06f3Robert Mustacchi	/*
2232ce06f3Robert Mustacchi	 * Family 0x15 models 60-6f
2242ce06f3Robert Mustacchi	 */
2252ce06f3Robert Mustacchi#define	A_SKTS_9			9
2262ce06f3Robert Mustacchi	{
2272ce06f3Robert Mustacchi		X86_SOCKET_FP4,		/* 0b000 */
2282ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b001 */
2292ce06f3Robert Mustacchi		X86_SOCKET_AM4,		/* 0b010 */
2302ce06f3Robert Mustacchi		X86_SOCKET_FM2R2,	/* 0b011 */
2312ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b100 */
2322ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b101 */
2332ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b110 */
2342ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN	/* 0b111 */
2352ce06f3Robert Mustacchi	},
2362ce06f3Robert Mustacchi
2372ce06f3Robert Mustacchi	/*
2382ce06f3Robert Mustacchi	 * Family 0x15 models 70-7f
2392ce06f3Robert Mustacchi	 */
2402ce06f3Robert Mustacchi#define	A_SKTS_10			10
2412ce06f3Robert Mustacchi	{
2422ce06f3Robert Mustacchi		X86_SOCKET_FP4,		/* 0b000 */
2432ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b001 */
2442ce06f3Robert Mustacchi		X86_SOCKET_AM4,		/* 0b010 */
2452ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b011 */
2462ce06f3Robert Mustacchi		X86_SOCKET_FT4,		/* 0b100 */
2472ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b101 */
2482ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b110 */
2492ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN	/* 0b111 */
2502ce06f3Robert Mustacchi	},
2512ce06f3Robert Mustacchi
2522ce06f3Robert Mustacchi	/*
2532ce06f3Robert Mustacchi	 * Family 0x16 models 00-0f
2542ce06f3Robert Mustacchi	 */
2552ce06f3Robert Mustacchi#define	A_SKTS_11			11
2562ce06f3Robert Mustacchi	{
2572ce06f3Robert Mustacchi		X86_SOCKET_FT3,		/* 0b000 */
2582ce06f3Robert Mustacchi		X86_SOCKET_FS1B,	/* 0b001 */
2592ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b010 */
2602ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b011 */
2612ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b100 */
2622ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b101 */
2632ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b110 */
2642ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN	/* 0b111 */
2652ce06f3Robert Mustacchi	},
2662ce06f3Robert Mustacchi
2672ce06f3Robert Mustacchi	/*
2682ce06f3Robert Mustacchi	 * Family 0x16 models 30-3f
2692ce06f3Robert Mustacchi	 */
2702ce06f3Robert Mustacchi#define	A_SKTS_12			12
2712ce06f3Robert Mustacchi	{
2722ce06f3Robert Mustacchi		X86_SOCKET_FT3B,	/* 0b000 */
2732ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b001 */
2742ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b010 */
2752ce06f3Robert Mustacchi		X86_SOCKET_FP4,		/* 0b011 */
2762ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b100 */
2772ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b101 */
2782ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b110 */
2792ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN	/* 0b111 */
2802ce06f3Robert Mustacchi	},
2812ce06f3Robert Mustacchi
2822ce06f3Robert Mustacchi	/*
2832ce06f3Robert Mustacchi	 * Family 0x17 models 00-0f
2842ce06f3Robert Mustacchi	 */
2852ce06f3Robert Mustacchi#define	A_SKTS_13			13
2862ce06f3Robert Mustacchi	{
2872ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b000 */
2882ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b001 */
2892ce06f3Robert Mustacchi		X86_SOCKET_AM4,		/* 0b010 */
2902ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b011 */
2912ce06f3Robert Mustacchi		X86_SOCKET_SP3,		/* 0b100 */
2922ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b101 */
2932ce06f3Robert Mustacchi		X86_SOCKET_UNKNOWN,	/* 0b110 */
2942ce06f3Robert Mustacchi		X86_SOCKET_SP3R2	/* 0b111 */
2952ce06f3Robert Mustacchi	},
2962ce06f3Robert Mustacchi
297e4b8688Cheng Sean Ye};
298e4b8688Cheng Sean Ye
29989e921dKuriakose Kuruvillastruct amd_sktmap_s {
30089e921dKuriakose Kuruvilla	uint32_t	skt_code;
30189e921dKuriakose Kuruvilla	char		sktstr[16];
30289e921dKuriakose Kuruvilla};
3032ce06f3Robert Mustacchistatic struct amd_sktmap_s amd_sktmap[X86_NUM_SOCKETS_AMD + 1] = {
30489e921dKuriakose Kuruvilla	{ X86_SOCKET_754,	"754" },
30589e921dKuriakose Kuruvilla	{ X86_SOCKET_939,	"939" },
30689e921dKuriakose Kuruvilla	{ X86_SOCKET_940,	"940" },
30789e921dKuriakose Kuruvilla	{ X86_SOCKET_S1g1,	"S1g1" },
30889e921dKuriakose Kuruvilla	{ X86_SOCKET_AM2,	"AM2" },
30989e921dKuriakose Kuruvilla	{ X86_SOCKET_F1207,	"F(1207)" },
31089e921dKuriakose Kuruvilla	{ X86_SOCKET_S1g2,	"S1g2" },
31189e921dKuriakose Kuruvilla	{ X86_SOCKET_S1g3,	"S1g3" },
31289e921dKuriakose Kuruvilla	{ X86_SOCKET_AM,	"AM" },
31389e921dKuriakose Kuruvilla	{ X86_SOCKET_AM2R2,	"AM2r2" },
31489e921dKuriakose Kuruvilla	{ X86_SOCKET_AM3,	"AM3" },
31589e921dKuriakose Kuruvilla	{ X86_SOCKET_G34,	"G34" },
316bd15239Srihari Venkatesan	{ X86_SOCKET_ASB2,	"ASB2" },
317bd15239Srihari Venkatesan	{ X86_SOCKET_C32,	"C32" },
3187932179Jens Elkner	{ X86_SOCKET_FT1,	"FT1" },
3197932179Jens Elkner	{ X86_SOCKET_FM1,	"FM1" },
3207932179Jens Elkner	{ X86_SOCKET_FS1,	"FS1" },
3217932179Jens Elkner	{ X86_SOCKET_AM3R2,	"AM3r2" },
3227932179Jens Elkner	{ X86_SOCKET_FP2,	"FP2" },
3237932179Jens Elkner	{ X86_SOCKET_FS1R2,	"FS1r2" },
3247932179Jens Elkner	{ X86_SOCKET_FM2,	"FM2" },
3252ce06f3Robert Mustacchi	{ X86_SOCKET_FP3,	"FP3" },
3262ce06f3Robert Mustacchi	{ X86_SOCKET_FM2R2,	"FM2r2" },
3272ce06f3Robert Mustacchi	{ X86_SOCKET_FP4,	"FP4" },
3282ce06f3Robert Mustacchi	{ X86_SOCKET_AM4,	"AM4" },
3292ce06f3Robert Mustacchi	{ X86_SOCKET_FT3,	"FT3" },
3302ce06f3Robert Mustacchi	{ X86_SOCKET_FT4,	"FT4" },
3312ce06f3Robert Mustacchi	{ X86_SOCKET_FS1B,	"FS1b" },
3322ce06f3Robert Mustacchi	{ X86_SOCKET_FT3B,	"FT3b" },
3332ce06f3Robert Mustacchi	{ X86_SOCKET_SP3,	"SP3" },
3342ce06f3Robert Mustacchi	{ X86_SOCKET_SP3R2,	"SP3r2" },
33589e921dKuriakose Kuruvilla	{ X86_SOCKET_UNKNOWN,	"Unknown" }
33689e921dKuriakose Kuruvilla};
33789e921dKuriakose Kuruvilla
338e4b8688Cheng Sean Ye/*
339e4b8688Cheng Sean Ye * Table for mapping AMD Family 0xf and AMD Family 0x10 model/stepping
340e4b8688Cheng Sean Ye * combination to chip "revision" and socket type.
341e4b8688Cheng Sean Ye *
342e4b8688Cheng Sean Ye * The first member of this array that matches a given family, extended model
343e4b8688Cheng Sean Ye * plus model range, and stepping range will be considered a match.
344e4b8688Cheng Sean Ye */
345e4b8688Cheng Sean Yestatic const struct amd_rev_mapent {
346e4b8688Cheng Sean Ye	uint_t rm_family;
347e4b8688Cheng Sean Ye	uint_t rm_modello;
348e4b8688Cheng Sean Ye	uint_t rm_modelhi;
349e4b8688Cheng Sean Ye	uint_t rm_steplo;
350e4b8688Cheng Sean Ye	uint_t rm_stephi;
351e4b8688Cheng Sean Ye	uint32_t rm_chiprev;
352e4b8688Cheng Sean Ye	const char *rm_chiprevstr;
353e4b8688Cheng Sean Ye	int rm_sktidx;
354e4b8688Cheng Sean Ye} amd_revmap[] = {
355e4b8688Cheng Sean Ye	/*
356e4b8688Cheng Sean Ye	 * =============== AuthenticAMD Family 0xf ===============
357e4b8688Cheng Sean Ye	 */
358