From nobody Tue May 21 02:46:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjzN84Df3z5Kgqp; Tue, 21 May 2024 02:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjzN82hKgz58gZ; Tue, 21 May 2024 02:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2XLbhcVvkizPv6/IWMyufRCFX/NUsLcN+S8Aw0qHuJg=; b=GcTPE3stVdGyKOcQl/4sWtkhz6D0WoM6GeU1+Um1g4/wOnZyctLXTGlV2oPJtN8g3WnSte 9tOQoddTr/SRmV+TY9sKBI0jaJtEmnlseuWl6Eszs2q8Av/tEYd7YFvQBjoRIqhE80mcM8 fZ/4HVnbzYdMWkidMHhd6rJ1cV8wPUMFF4Yx0EPFLAhQGQUZud4XlwiRnbOAQyskcPvV1o xnurjOK8YAfcSv/Ktg54hxulDRFoC4VyKxBvZ4bauR3jirrjlyAcpsoit7KBkckP+NDWJU yIMCgpB6tbDt96eay+UsN2zIMqMguLDkMJYqBfI/tuw09UaYCknWiBtfQzEG1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716259592; a=rsa-sha256; cv=none; b=UtV6XLCwsgr9Qm5biNk1RPNd7EIic4kWOBBnrgDUFDPrL0zfkAolo6qmwfIOtuwPiVbVVw 3mS921MnwFSYaVpYQWGYdDWlJdHawUsUA1YBfaXqzPE9XPJkpKzIcHR25frRsFTlEKS39s LaGIhIfvwDQxHK6yLPzmyR0FluBoARsX1tRteAY+6X1LYn5v31ce29klXk9jOICAPsj5ZK Iqo43GyJg6SrBrYZvMaivgoPOKzLJjCQ4sdeBKVgpcM1DWkwnd+lwSNXPP+64OwKlv0qHt r9cDH8afZQT9qS9Xn9YG89pMHoaDuo7UgCq+3oNWXSRB5PgZLgi/bK1C5sdNVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2XLbhcVvkizPv6/IWMyufRCFX/NUsLcN+S8Aw0qHuJg=; b=tLf97SoMOODMYjjfk5RTCK2RAORdt2GGg4tt8JgLRpvjoNI9MNhbvq1H5xHc8iAwhAbbrI wy3A505gctUvv3p3+itGbOJ8GWal3B4Gsf7dt1DbHibgo1NYE3PXd0eiNmANFykjuPGJBD 2pnje0Z7V4FVZd3cBPgN2pPwTkV4SfrocnQ47ua1n60jlVb4VhODqgGj7DQVeLJyhYyhgI cyOo742R8yiNZqb3CabgJYHp3n/H5kJxz79GmLcAiA6o2V8vJ8EVaP0MvI6xoxnmdEDiWu W5XA9gzsaT5dnk6QSd6B/M13lky66QMEZOZ8KTvcllwKOBMu0kMgAmjm5fVOnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjzN82JGVz13V5; Tue, 21 May 2024 02:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L2kWBP082677; Tue, 21 May 2024 02:46:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L2kWsx082674; Tue, 21 May 2024 02:46:32 GMT (envelope-from git) Date: Tue, 21 May 2024 02:46:32 GMT Message-Id: <202405210246.44L2kWsx082674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f03a01194c11 - stable/14 - AMD CPUs: update bits and data from CPUID 0x8000_0008 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f03a01194c112d356ef0067e2b367355b8e38d07 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f03a01194c112d356ef0067e2b367355b8e38d07 commit f03a01194c112d356ef0067e2b367355b8e38d07 Author: Konstantin Belousov AuthorDate: 2024-05-13 23:02:16 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-21 02:45:59 +0000 AMD CPUs: update bits and data from CPUID 0x8000_0008 (cherry picked from commit c6113ac5a2c2bfee875979ebd40a007ef4d60069) --- sys/x86/include/specialreg.h | 17 +++++++++++++++++ sys/x86/include/x86_var.h | 1 + sys/x86/x86/identcpu.c | 12 ++++++++++++ 3 files changed, 30 insertions(+) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index f78e04c714f0..16aa07c05e65 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -399,21 +399,31 @@ #define AMDFEID_CLZERO 0x00000001 #define AMDFEID_IRPERF 0x00000002 #define AMDFEID_XSAVEERPTR 0x00000004 +#define AMDFEID_INVLPGB 0x00000008 #define AMDFEID_RDPRU 0x00000010 +#define AMDFEID_BE 0x00000040 #define AMDFEID_MCOMMIT 0x00000100 #define AMDFEID_WBNOINVD 0x00000200 #define AMDFEID_IBPB 0x00001000 +#define AMDFEID_INT_WBINVD 0x00002000 #define AMDFEID_IBRS 0x00004000 #define AMDFEID_STIBP 0x00008000 /* The below are only defined if the corresponding base feature above exists. */ #define AMDFEID_IBRS_ALWAYSON 0x00010000 #define AMDFEID_STIBP_ALWAYSON 0x00020000 #define AMDFEID_PREFER_IBRS 0x00040000 +#define AMDFEID_SAMEMODE_IBRS 0x00080000 +#define AMDFEID_NO_LMSLE 0x00100000 +#define AMDFEID_INVLPGB_NEST 0x00200000 #define AMDFEID_PPIN 0x00800000 #define AMDFEID_SSBD 0x01000000 /* SSBD via MSRC001_011F instead of MSR 0x48: */ #define AMDFEID_VIRT_SSBD 0x02000000 #define AMDFEID_SSB_NO 0x04000000 +#define AMDFEID_CPPC 0x08000000 +#define AMDFEID_PSFD 0x10000000 +#define AMDFEID_BTC_NO 0x20000000 +#define AMDFEID_IBPB_RET 0x40000000 /* * AMD extended function 8000_0008h ecx info @@ -422,6 +432,13 @@ #define AMDID_COREID_SIZE 0x0000f000 #define AMDID_COREID_SIZE_SHIFT 12 +/* + * AMD extended function 8000_0008h edx info + */ +#define AMDID_INVLPGB_MAXCNT 0x0000ffff +#define AMDID_RDPRU_SHIFT 16 +#define AMDID_RDPRU_ID 0xffff0000 + /* * CPUID instruction 7 Structured Extended Features, leaf 0 ebx info */ diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index f3677d84570b..f19c557e270b 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -57,6 +57,7 @@ extern u_int cpu_max_ext_state_size; extern u_int cpu_mxcsr_mask; extern u_int cpu_procinfo; extern u_int cpu_procinfo2; +extern u_int cpu_procinfo3; extern char cpu_vendor[]; extern char cpu_model[]; extern u_int cpu_vendor_id; diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 9c82f9f8a882..7df20053a9d1 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -102,6 +102,7 @@ u_int cpu_exthigh; /* Highest arg to extended CPUID */ u_int cpu_id; /* Stepping ID */ u_int cpu_procinfo; /* HyperThreading Info / Brand Index / CLFUSH */ u_int cpu_procinfo2; /* Multicore info */ +u_int cpu_procinfo3; char cpu_vendor[20]; /* CPU Origin code */ u_int cpu_vendor_id; /* CPU vendor ID */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ @@ -1085,19 +1086,29 @@ printcpuinfo(void) "\001CLZERO" "\002IRPerf" "\003XSaveErPtr" + "\004INVLPGB" "\005RDPRU" + "\007BE" "\011MCOMMIT" "\012WBNOINVD" "\015IBPB" + "\016INT_WBINVD" "\017IBRS" "\020STIBP" "\021IBRS_ALWAYSON" "\022STIBP_ALWAYSON" "\023PREFER_IBRS" + "\024SAMEMODE_IBRS" + "\025NOLMSLE" + "\026INVLPGBNEST" "\030PPIN" "\031SSBD" "\032VIRT_SSBD" "\033SSB_NO" + "\034CPPC" + "\035PSFD" + "\036BTC_NO" + "\037IBPB_RET" ); } @@ -1636,6 +1647,7 @@ finishidentcpu(void) cpu_maxphyaddr = regs[0] & 0xff; amd_extended_feature_extensions = regs[1]; cpu_procinfo2 = regs[2]; + cpu_procinfo3 = regs[3]; } else { cpu_maxphyaddr = (cpu_feature & CPUID_PAE) != 0 ? 36 : 32; }