From c0692105a8b350050833b89a3c492068ed009b09 Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Fri, 3 Apr 2020 05:16:40 +0000 Subject: 11975 Update AMD CPUID for F17 M10,30,70 Reviewed by: Richard Lowe Reviewed by: Jason Lippert Reviewed by: Toomas Soome Approved by: Joshua M. Clulow --- usr/src/uts/intel/sys/x86_archext.h | 18 +++++++++++++++++- 1 file changed, 17 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 6c8e2d22bb..1999d6c568 100644 --- a/usr/src/uts/intel/sys/x86_archext.h +++ b/usr/src/uts/intel/sys/x86_archext.h @@ -907,6 +907,21 @@ extern "C" { #define X86_CHIPREV_AMD_17_PiR_B2 \ _X86_CHIPREV_MKREV(X86_VENDOR_AMD, 0x17, 0x0003) +#define X86_CHIPREV_AMD_17_RV_B0 \ + _X86_CHIPREV_MKREV(X86_VENDOR_AMD, 0x17, 0x0004) + +#define X86_CHIPREV_AMD_17_RV_B1 \ + _X86_CHIPREV_MKREV(X86_VENDOR_AMD, 0x17, 0x0005) + +#define X86_CHIPREV_AMD_17_PCO_B1 \ + _X86_CHIPREV_MKREV(X86_VENDOR_AMD, 0x17, 0x0006) + +#define X86_CHIPREV_AMD_17_SSP_A0 \ + _X86_CHIPREV_MKREV(X86_VENDOR_AMD, 0x17, 0x0007) + +#define X86_CHIPREV_AMD_17_SSP_B0 \ + _X86_CHIPREV_MKREV(X86_VENDOR_AMD, 0x17, 0x0008) + /* * Various socket/package types, extended as the need to distinguish * a new type arises. The top 8 byte identfies the vendor and the @@ -961,7 +976,8 @@ extern "C" { #define X86_SOCKET_FT3B _X86_SOCKET_MKVAL(X86_VENDOR_AMD, 0x1e) #define X86_SOCKET_SP3 _X86_SOCKET_MKVAL(X86_VENDOR_AMD, 0x1f) #define X86_SOCKET_SP3R2 _X86_SOCKET_MKVAL(X86_VENDOR_AMD, 0x20) -#define X86_NUM_SOCKETS_AMD 0x21 +#define X86_SOCKET_FP5 _X86_SOCKET_MKVAL(X86_VENDOR_AMD, 0x21) +#define X86_NUM_SOCKETS_AMD 0x22 /* -- cgit v1.2.3 From 0e6adfea4a40da04a1864bdeed7e17450ce04df5 Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Fri, 3 Apr 2020 05:16:46 +0000 Subject: 11976 Want CPU temperature sensors for Zen 2, Raven Ridge Reviewed by: Toomas Soome Approved by: Joshua M. Clulow --- usr/src/man/man7d/amdf17nbdf.7d | 4 ++-- usr/src/pkg/manifests/driver-cpu-sensor.mf | 7 ++++++- usr/src/uts/intel/io/amdf17nbdf/amdf17nbdf.c | 31 +++++++++++++++++++++++++--- 3 files changed, 36 insertions(+), 6 deletions(-) (limited to 'usr/src/uts/intel') diff --git a/usr/src/man/man7d/amdf17nbdf.7d b/usr/src/man/man7d/amdf17nbdf.7d index 739eab6c82..e6e6ce863d 100644 --- a/usr/src/man/man7d/amdf17nbdf.7d +++ b/usr/src/man/man7d/amdf17nbdf.7d @@ -11,7 +11,7 @@ .\" .\" Copyright 2019, Joyent, Inc. .\" -.Dd March 20, 2019 +.Dd November 16, 2019 .Dt AMDF17NBDF 7D .Os .Sh NAME @@ -24,7 +24,7 @@ The .Nm driver provides the system access to the Northbridge and Data Fabric devices on AMD Family 17h -.Pq Zen +.Pq Zen, Zen+, and Zen 2 processors allowing the operating system to communicate with the system management unit .Pq SMU . diff --git a/usr/src/pkg/manifests/driver-cpu-sensor.mf b/usr/src/pkg/manifests/driver-cpu-sensor.mf index 5ce38d340f..4deea9570f 100644 --- a/usr/src/pkg/manifests/driver-cpu-sensor.mf +++ b/usr/src/pkg/manifests/driver-cpu-sensor.mf @@ -30,8 +30,13 @@ dir path=usr/lib/devfsadm/linkmod group=sys dir path=usr/share/man dir path=usr/share/man/man7d driver name=amdf17nbdf \ + alias=pci1022,1440,p \ alias=pci1022,1450,p \ - alias=pci1022,1460,p + alias=pci1022,1460,p \ + alias=pci1022,1480,p \ + alias=pci1022,1490,p \ + alias=pci1022,15d0,p \ + alias=pci1022,15e8,p driver name=amdnbtemp \ alias=pci1022,1203,p \ alias=pci1022,1303,p \ diff --git a/usr/src/uts/intel/io/amdf17nbdf/amdf17nbdf.c b/usr/src/uts/intel/io/amdf17nbdf/amdf17nbdf.c index 11bddfa515..b1191f8f9e 100644 --- a/usr/src/uts/intel/io/amdf17nbdf/amdf17nbdf.c +++ b/usr/src/uts/intel/io/amdf17nbdf/amdf17nbdf.c @@ -75,9 +75,9 @@ * value in the corresponding data fabric's AMDF17_DF_CFG_ADDR_CTL. * * This means that we can map a northbridge to a data fabric device and a data - * fabric device to a die. Because these are 1:1 mappings, there is a transitive - * relationship and therefore we know which northbridge is associated with which - * processor die. This is summarized in the following image: + * fabric device to a die. Because these are generally 1:1 mappings, there is a + * transitive relationship and therefore we know which northbridge is associated + * with which processor die. This is summarized in the following image: * * +-------+ +----------------------------+ +--------------+ * | Die 0 | ---> | Data Fabric PCI BDF 0/18/0 |-------> | Northbridge | @@ -93,6 +93,17 @@ * of the data fabric accurately models hardware. All of the BDF values are in * hex. * + * Starting with the Rome generation of processors (Family 17h Model 30-3Fh), + * AMD has multiple northbridges that exist on a given die. All of these + * northbridges share the same data fabric and system management network port. + * From our perspective this means that some of the northbridge devices will be + * redundant and that we will no longer have a 1:1 mapping between the + * northbridge and the data fabric devices. Every data fabric will have a + * northbridge, but not every northbridge will have a data fabric device mapped. + * Because we're always trying to map from a die to a northbridge and not the + * reverse, the fact that there are extra northbridge devices hanging around + * that we don't know about shouldn't be a problem. + * * ------------------------------- * Attach and Detach Complications * ------------------------------- @@ -246,6 +257,20 @@ static const amdf17nbdf_table_t amdf17nbdf_dev_map[] = { /* Family 17h Ryzen, Epyc Models 00h-0fh (Zen uarch) */ { 0x1450, AMD_NBDF_TYPE_NORTHBRIDGE }, { 0x1460, AMD_NBDF_TYPE_DATA_FABRIC }, + /* Family 17h Raven Ridge Models 10h-1fh (Zen uarch) */ + { 0x15d0, AMD_NBDF_TYPE_NORTHBRIDGE }, + { 0x15e8, AMD_NBDF_TYPE_DATA_FABRIC }, + /* Family 17h Epyc Models 30h-3fh (Zen 2 uarch) */ + { 0x1480, AMD_NBDF_TYPE_NORTHBRIDGE }, + { 0x1490, AMD_NBDF_TYPE_DATA_FABRIC }, + /* + * Family 17h Ryzen Models 70-7fh (Zen 2 uarch) + * + * While this family has its own PCI ID for the data fabric device, it + * shares the same northbridge ID as the Zen 2 EPYC models 30-3f -- + * 0x1480. + */ + { 0x1440, AMD_NBDF_TYPE_DATA_FABRIC }, { PCI_EINVAL16 } }; -- cgit v1.2.3 From 3afb2a2ae94e9183977495f0d248b766e58e4016 Mon Sep 17 00:00:00 2001 From: John Levon Date: Thu, 2 Apr 2020 10:56:44 -0700 Subject: 12464 fix kmdb build Reviewed by: Robert Mustacchi Reviewed by: Toomas Soome Approved by: Richard Lowe --- usr/src/pkg/manifests/system-header.mf | 2 + usr/src/uts/intel/ia32/sys/Makefile | 6 ++- usr/src/uts/intel/ia32/sys/kdi_regs.h | 73 ++++++++++++++++++++++++++++++++++ usr/src/uts/intel/ia32/sys/privmregs.h | 67 +++++++++++++++++++++++++++++++ 4 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 usr/src/uts/intel/ia32/sys/kdi_regs.h create mode 100644 usr/src/uts/intel/ia32/sys/privmregs.h (limited to 'usr/src/uts/intel') diff --git a/usr/src/pkg/manifests/system-header.mf b/usr/src/pkg/manifests/system-header.mf index cbb67a6738..bb961d21ce 100644 --- a/usr/src/pkg/manifests/system-header.mf +++ b/usr/src/pkg/manifests/system-header.mf @@ -386,7 +386,9 @@ file path=usr/include/gssapi/gssapi_ext.h file path=usr/include/hal/libhal-storage.h file path=usr/include/hal/libhal.h $(i386_ONLY)file path=usr/include/ia32/sys/asm_linkage.h +$(i386_ONLY)file path=usr/include/ia32/sys/kdi_regs.h $(i386_ONLY)file path=usr/include/ia32/sys/machtypes.h +$(i386_ONLY)file path=usr/include/ia32/sys/privmregs.h $(i386_ONLY)file path=usr/include/ia32/sys/privregs.h $(i386_ONLY)file path=usr/include/ia32/sys/psw.h $(i386_ONLY)file path=usr/include/ia32/sys/pte.h diff --git a/usr/src/uts/intel/ia32/sys/Makefile b/usr/src/uts/intel/ia32/sys/Makefile index 5f4708436f..0ef2320b16 100644 --- a/usr/src/uts/intel/ia32/sys/Makefile +++ b/usr/src/uts/intel/ia32/sys/Makefile @@ -19,17 +19,21 @@ # CDDL HEADER END # # +#pragma ident "%Z%%M% %I% %E% SMI" +# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# Copyright 2020 Joyent, Inc. +# uts/intel/ia32/sys/Makefile # # include global definitions include ../../../../Makefile.master HDRS= \ asm_linkage.h \ + kdi_regs.h \ machtypes.h \ + privmregs.h \ privregs.h \ psw.h \ pte.h \ diff --git a/usr/src/uts/intel/ia32/sys/kdi_regs.h b/usr/src/uts/intel/ia32/sys/kdi_regs.h new file mode 100644 index 0000000000..e87948189a --- /dev/null +++ b/usr/src/uts/intel/ia32/sys/kdi_regs.h @@ -0,0 +1,73 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + * + * Copyright 2018 Joyent, Inc. + */ + +#ifndef _IA32_SYS_KDI_REGS_H +#define _IA32_SYS_KDI_REGS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define KDIREG_NGREG 21 + +/* + * %ss appears in a different place than a typical struct regs, since the + * machine won't save %ss on a trap entry from the same privilege level. + */ + +#define KDIREG_SAVFP 0 +#define KDIREG_SAVPC 1 +#define KDIREG_SS 2 +#define KDIREG_GS 3 +#define KDIREG_FS 4 +#define KDIREG_ES 5 +#define KDIREG_DS 6 +#define KDIREG_EDI 7 +#define KDIREG_ESI 8 +#define KDIREG_EBP 9 +#define KDIREG_ESP 10 +#define KDIREG_EBX 11 +#define KDIREG_EDX 12 +#define KDIREG_ECX 13 +#define KDIREG_EAX 14 +#define KDIREG_TRAPNO 15 +#define KDIREG_ERR 16 +#define KDIREG_EIP 17 +#define KDIREG_CS 18 +#define KDIREG_EFLAGS 19 +#define KDIREG_UESP 20 + +#define KDIREG_PC KDIREG_EIP +#define KDIREG_SP KDIREG_ESP +#define KDIREG_FP KDIREG_EBP + +#ifdef __cplusplus +} +#endif + +#endif /* _IA32_SYS_KDI_REGS_H */ diff --git a/usr/src/uts/intel/ia32/sys/privmregs.h b/usr/src/uts/intel/ia32/sys/privmregs.h new file mode 100644 index 0000000000..87d9b74bfe --- /dev/null +++ b/usr/src/uts/intel/ia32/sys/privmregs.h @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _IA32_SYS_PRIVMREGS_H +#define _IA32_SYS_PRIVMREGS_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(__i386) +#error "non-i386 code depends on i386 privileged header!" +#endif + +#ifndef _ASM + +#define PM_GREGS (1 << 0) +#define PM_CRREGS (1 << 1) +#define PM_DRREGS (1 << 2) + +/* + * This structure is intended to represent a complete machine state for a CPU, + * when that information is available. It is only for use internally between + * KMDB and the kernel, or within MDB. Note that this isn't yet finished. + */ +typedef struct privmregs { + ulong_t pm_flags; + /* general registers */ + struct regs pm_gregs; + /* cr0-8 */ + ulong_t pm_cr[8]; + /* dr0-8 */ + ulong_t pm_dr[8]; +} privmregs_t; + +#endif /* !_ASM */ + +#ifdef __cplusplus +} +#endif + +#endif /* !_IA32_SYS_PRIVMREGS_H */ -- cgit v1.2.3