From 5edbd2fec7b63b423df5bd21c4b0f7b775123a40 Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Sun, 27 Sep 2020 13:30:21 -0700 Subject: 13238 vaes, vpclmulqdq should be plumbed through isainfo 13239 umip, etc. are incorrectly conditioned in cpuid.c Reviewed by: Peter Tribble Reviewed by: Toomas Soome Approved by: Dan McDonald --- usr/src/uts/intel/sys/x86_archext.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr/src/uts/intel') diff --git a/usr/src/uts/intel/sys/x86_archext.h b/usr/src/uts/intel/sys/x86_archext.h index eed3c5fd4e..f434eaf41a 100644 --- a/usr/src/uts/intel/sys/x86_archext.h +++ b/usr/src/uts/intel/sys/x86_archext.h @@ -735,6 +735,8 @@ extern "C" { #define X86FSET_TSX_CTRL 97 #define X86FSET_TAA_NO 98 #define X86FSET_PPIN 99 +#define X86FSET_VAES 100 +#define X86FSET_VPCLMULQDQ 101 /* * Intel Deep C-State invariant TSC in leaf 0x80000007. @@ -1116,7 +1118,7 @@ extern "C" { #if defined(_KERNEL) || defined(_KMEMUSER) -#define NUM_X86_FEATURES 100 +#define NUM_X86_FEATURES 102 extern uchar_t x86_featureset[]; extern void free_x86_featureset(void *featureset); -- cgit v1.2.3 From e9abe9d6424a9213df11b3243f6957e6a0b91e48 Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Sat, 26 Sep 2020 11:16:12 -0700 Subject: 13235 amdzen(7D) support for Zen 3 Reviewed by: C Fraire Reviewed by: Patrick Mooney Approved by: Dan McDonald --- usr/src/man/man7d/amdzen.7d | 46 ++++++++++++++++++++++++----- usr/src/pkg/manifests/driver-cpu-amd-zen.mf | 17 ++++++++--- usr/src/uts/intel/io/amdzen/amdzen.c | 16 ++++++++-- 3 files changed, 64 insertions(+), 15 deletions(-) (limited to 'usr/src/uts/intel') diff --git a/usr/src/man/man7d/amdzen.7d b/usr/src/man/man7d/amdzen.7d index 171d36b0d6..7c24b7106a 100644 --- a/usr/src/man/man7d/amdzen.7d +++ b/usr/src/man/man7d/amdzen.7d @@ -11,7 +11,7 @@ .\" .\" Copyright 2020 Oxide Computer Company .\" -.Dd September 1, 2020 +.Dd September 26, 2020 .Dt AMDZEN 7D .Os .Sh NAME @@ -20,13 +20,29 @@ .Nd AMD Zen Nexus Driver .Sh DESCRIPTION The -.Sy amdzen -driver provides access to the AMD Zen, Zen+, and Zen 2 +.Nm +driver provides access to the Northbridge, Data Fabric, and System +Management Network +.Pq SMN +for a number of AMD processor lines, including AMD Ryzen CPUs and APUs, +ThreadRipper CPUs, and EPYC CPUs from the following families: +.Bl -bullet +.It +AMD Zen Naples, Summit Ridge, Whitehaven +.Pq Family 17h +.It +AMD Zen+ Colfax, Picasso, and Pinnacle Ridge .Pq Family 17h -processor families Northbridge, Data Fabric, and System Management Network -.Pq SMN . -This driver is a nexus driver and facilitates access to these devices -between various other devices such as +.It +AMD Zen 2 Castle Peak, Matisse, Rome, and Renoir +.Pq Family 17h +.It +AMD Zen 3 Milan and Vermeer +.Pq Family 19h +.El +.Pp +This driver is a nexus driver and facilitates access to the northbridge, +data fabric, and SMN between various other devices such as .Xr smntemp 7D . The various processor devices that make up the northbridge and data fabric have the @@ -36,6 +52,20 @@ The different devices are all amalgamated and a single uniform view is provided by the .Sy amdzen driver. +.Pp +The +.Nm +driver is a nexus driver that has the following children: +.Bl -tag -width "smntemp(7D)" +.It Xr smntemp 7D +Provides access to on-die temperature sensors. +.It Xr usmn 7D +Provides read access to the SMN. +This driver is intended for development purposes. +.It Xr zen_udf 7D +Provides read access to the data fabric. +This driver is intended for development purposes. +.El .Sh ARCHITECTURE The .Sy amdzen @@ -43,7 +73,7 @@ and .Sy amdzen_stub drivers are limited to .Sy x86 -platforms with AMD Family 17h processors. +platforms with AMD Family 17h and 19h processors. .Sh SEE ALSO .Xr smntemp 7D , .Xr usmn 7D , diff --git a/usr/src/pkg/manifests/driver-cpu-amd-zen.mf b/usr/src/pkg/manifests/driver-cpu-amd-zen.mf index df4adf3339..d0bb700cfb 100644 --- a/usr/src/pkg/manifests/driver-cpu-amd-zen.mf +++ b/usr/src/pkg/manifests/driver-cpu-amd-zen.mf @@ -27,15 +27,16 @@ dir path=usr/share/man dir path=usr/share/man/man7d driver name=amdzen # -# 1440-1447: f17h m70-7fh df +# 1440-1447: f17h m70-7fh, f19h m20-2f df # 1448-144f: f17h m60-6fh df # 1450: f17h m00-0f nb # 1460-1467: f17h m00-0f df -# 1480: f17h m30-3f/70-7f nb -# 1490-1497: f17h m30-3f nb +# 1480: f17h m30-3f/70-7f, f19h m00-0f, m20-2f nb +# 1490-1497: f17h m30-3f df # 15d0: f17h m10-m2f nb # 15e8-15ef: f17h m10-m2f df # 1630: f17h m60-6f nb +# 1650-1657: f19h m00-0f df # driver name=amdzen_stub \ alias=pci1022,1440,p \ @@ -81,7 +82,15 @@ driver name=amdzen_stub \ alias=pci1022,15ed,p \ alias=pci1022,15ee,p \ alias=pci1022,15ef,p \ - alias=pci1022,1630,p + alias=pci1022,1630,p \ + alias=pci1022,1650,p \ + alias=pci1022,1651,p \ + alias=pci1022,1652,p \ + alias=pci1022,1653,p \ + alias=pci1022,1654,p \ + alias=pci1022,1655,p \ + alias=pci1022,1656,p \ + alias=pci1022,1657,p file path=kernel/drv/$(ARCH64)/amdzen group=sys file path=kernel/drv/$(ARCH64)/amdzen_stub group=sys file path=kernel/drv/amdzen.conf group=sys diff --git a/usr/src/uts/intel/io/amdzen/amdzen.c b/usr/src/uts/intel/io/amdzen/amdzen.c index 25e38ee988..ac6ce9c94f 100644 --- a/usr/src/uts/intel/io/amdzen/amdzen.c +++ b/usr/src/uts/intel/io/amdzen/amdzen.c @@ -144,7 +144,7 @@ static const uint16_t amdzen_nb_ids[] = { 0x1450, /* Family 17h Raven Ridge, Kestrel, Dali Models 10h-2fh (Zen uarch) */ 0x15d0, - /* Family 17h Epyc Models 30h-3fh, Matisse 70-7fh (Zen 2 uarch) */ + /* Family 17h/19h Rome, Milan, Matisse, Vermeer Zen 2/Zen 3 uarch */ 0x1480, /* Family 17h Renoir Models 60-6fh (Zen 2 uarch) */ 0x1630 @@ -435,6 +435,16 @@ static const uint8_t amdzen_df_rome_ids[0x2b] = { 44, 45, 46, 47, 48 }; +/* + * Check the first df entry to see if it belongs to Rome or Milan. If so, then + * it uses the disjoint ID space. + */ +static boolean_t +amdzen_is_rome_style(uint_t id) +{ + return (id == 0x1490 || id == 0x1650); +} + /* * Initialize our knowledge about a given series of nodes on the data fabric. */ @@ -464,11 +474,11 @@ amdzen_setup_df(amdzen_t *azn, amdzen_df_t *df) * indexes that we iterate over, though the total number of * entries is right. */ - if (df->adf_funcs[0]->azns_did == 0x1490) { + if (amdzen_is_rome_style(df->adf_funcs[0]->azns_did)) { if (inst > ARRAY_SIZE(amdzen_df_rome_ids)) { dev_err(azn->azn_dip, CE_WARN, "Rome family " "processor reported more ids than the PPR, " - "resting %u to instance zero", inst); + "resetting %u to instance zero", inst); inst = 0; } else { inst = amdzen_df_rome_ids[inst]; -- cgit v1.2.3 From 059f070059c50b83e8b46b39b4dde67bf2feb1dc Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Tue, 13 Oct 2020 10:10:29 -0700 Subject: 13236 Want Zen 3 socket information Reviewed by: C Fraire Reviewed by: Patrick Mooney Approved by: Dan McDonald --- usr/src/uts/i86pc/os/cpuid_subr.c | 39 +++++++++++++++++++++++++++++++++++-- usr/src/uts/intel/sys/x86_archext.h | 3 ++- 2 files changed, 39 insertions(+), 3 deletions(-) (limited to 'usr/src/uts/intel') diff --git a/usr/src/uts/i86pc/os/cpuid_subr.c b/usr/src/uts/i86pc/os/cpuid_subr.c index 83b3e115eb..faa3e75b03 100644 --- a/usr/src/uts/i86pc/os/cpuid_subr.c +++ b/usr/src/uts/i86pc/os/cpuid_subr.c @@ -88,10 +88,12 @@ * 15 for family 0x17, models 30 - 3f * 16 for family 0x17, models 60 - 6f * 17 for family 0x17, models 70 - 7f + * 18 for family 0x19, models 00 - 0f + * 19 for family 0x19, models 20 - 2f * Second index by (model & 0x3) for family 0fh, * CPUID pkg bits (Fn8000_0001_EBX[31:28]) for later families. */ -static uint32_t amd_skts[18][8] = { +static uint32_t amd_skts[20][8] = { /* * Family 0xf revisions B through E */ @@ -361,6 +363,36 @@ static uint32_t amd_skts[18][8] = { X86_SOCKET_UNKNOWN, /* 0b110 */ X86_SOCKET_UNKNOWN /* 0b111 */ }, + + /* + * Family 0x19 models 00-0f (Zen 3 - Milan) + */ +#define A_SKTS_18 18 + { + X86_SOCKET_UNKNOWN, /* 0b000 */ + X86_SOCKET_UNKNOWN, /* 0b001 */ + X86_SOCKET_UNKNOWN, /* 0b010 */ + X86_SOCKET_UNKNOWN, /* 0b011 */ + X86_SOCKET_SP3, /* 0b100 */ + X86_SOCKET_UNKNOWN, /* 0b101 */ + X86_SOCKET_UNKNOWN, /* 0b110 */ + X86_SOCKET_STRX4 /* 0b111 */ + }, + + /* + * Family 0x19 models 20-2f (Zen 3 - Vermeer) + */ +#define A_SKTS_19 19 + { + X86_SOCKET_UNKNOWN, /* 0b000 */ + X86_SOCKET_UNKNOWN, /* 0b001 */ + X86_SOCKET_AM4, /* 0b010 */ + X86_SOCKET_UNKNOWN, /* 0b011 */ + X86_SOCKET_UNKNOWN, /* 0b100 */ + X86_SOCKET_UNKNOWN, /* 0b101 */ + X86_SOCKET_UNKNOWN, /* 0b110 */ + X86_SOCKET_UNKNOWN /* 0b111 */ + } }; struct amd_sktmap_s { @@ -401,6 +433,7 @@ static struct amd_sktmap_s amd_sktmap_strs[X86_NUM_SOCKETS_AMD + 1] = { { X86_SOCKET_SP3R2, "SP3r2" }, { X86_SOCKET_FP5, "FP5" }, { X86_SOCKET_FP6, "FP6" }, + { X86_SOCKET_STRX4, "sTRX4" }, { X86_SOCKET_UNKNOWN, "Unknown" } }; @@ -425,7 +458,9 @@ static const struct amd_skt_mapent { { 0x17, 0x10, 0x2f, A_SKTS_14 }, { 0x17, 0x30, 0x3f, A_SKTS_15 }, { 0x17, 0x60, 0x6f, A_SKTS_16 }, - { 0x17, 0x70, 0x7f, A_SKTS_17 } + { 0x17, 0x70, 0x7f, A_SKTS_17 }, + { 0x19, 0x00, 0x0f, A_SKTS_18 }, + { 0x19, 0x20, 0x2f, A_SKTS_19 } }; /* diff --git a/usr/src/uts/intel/sys/x86_archext.h b/usr/src/uts/intel/sys/x86_archext.h index f434eaf41a..b75ab18f5e 100644 --- a/usr/src/uts/intel/sys/x86_archext.h +++ b/usr/src/uts/intel/sys/x86_archext.h @@ -1023,7 +1023,8 @@ extern "C" { #define X86_SOCKET_SP3R2 _X86_SOCKET_MKVAL(X86_VENDOR_AMD, 0x20) #define X86_SOCKET_FP5 _X86_SOCKET_MKVAL(X86_VENDOR_AMD, 0x21) #define X86_SOCKET_FP6 _X86_SOCKET_MKVAL(X86_VENDOR_AMD, 0x22) -#define X86_NUM_SOCKETS_AMD 0x23 +#define X86_SOCKET_STRX4 _X86_SOCKET_MKVAL(X86_VENDOR_AMD, 0x23) +#define X86_NUM_SOCKETS_AMD 0x24 /* -- cgit v1.2.3