From nobody Tue May 14 23:06:50 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 4VfBnQ2h63z5L9V1; Tue, 14 May 2024 23:06:50 +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 4VfBnQ25fHz4dD5; Tue, 14 May 2024 23:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715728010; 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=p258t6AK99dka3dN5y460Rn8Ju38OlFeVamykz1z30M=; b=DbvoG++E1445O6HRastrs/EyxvP33MQpOyiHZsJufIqg5VWfR4Qn0HmR+mk/lrIVGtkGSF 3E32CAxKpcIbyKqNs79PyL5e7nrIPv6viJPFGK0ZQlGVlrqD9tVrEhutLhc8n2yNEc5LwE toiLhZFarC0k4ETUPg/d+Jwey3PlE5p4wEGLNpGuZbFDoOz/SmE2boZ6eGSYeS1p4w4ZT6 s00ZxhvfLv879OY53OgUsa4KIZxHVIH/yV1JxUm5KvkBdUgWO+mwOIZVkS7TI21GGr/18t A17nRd6zGSYP6+qcPqKccfhXnrF7oBjfIMCQMTQt6bOHZCZTVgqicEEqj17rFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715728010; a=rsa-sha256; cv=none; b=Q0LsaRPRxhiLczoDuJmXYidvvh7R8E5hm0cf7FWRrMvfCT/CvD5xzia/ligtpMDWr6DZRN UG7hgpWLjuJJV+fnmUc7TFFrocVGGHjQ6GI21tOmhxPfB+pEMkSAspjjKIWKjofxnf6q5i ZtvRPLBKIU4ZvGkXpAps6WfdUBbD7MmZZqIVRQ5tmMEoSqY02CAUJV4FvEAmsyCfuD3sba 5UsAJpJIkkYh4F4/iDsl4gojIzuudBgX2iXK5BQohEfDRDrgVSLIbuMxhqi+fAa5sy2xU7 zJicUDvPnV+y7aPiMdc3dfZs6NsQWZfF6zBCFrjcZKqZQNtiIcIFlDVtITT30A== 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=1715728010; 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=p258t6AK99dka3dN5y460Rn8Ju38OlFeVamykz1z30M=; b=ofa1sYvDZhil6jRdQibULfDdILYdRDDzMhK//ZcMTzCoQ/jK6a98YKGD0/vDXR8Ce8ZK2M V+TsiV+fKH3jnqkT7FcnbOmfppRvHt4sU44Pp3GzpPWsj7RE8b0y1Fs5jqjfv6M+pVPcp2 SztiTvv3msH6jvMryx0dXdNDVM0bDNdSWCvDY+ydECj9RckqYay67tslhxWhaJlkT+lnUT BVEG6CN4bqwPJLoP+xE6TSlAwSJsVSfOAACvJIdjIMJFwtCP7FkaRIPLj3poU9YueM+NbT w4jx/E/svodXMCRxezOjsf4GdEIFSKAeH1zNTkFa2Wtrd8L6hZi+4tNpdR2E/A== 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 4VfBnQ1jKhzrMx; Tue, 14 May 2024 23:06:50 +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 44EN6oJM047494; Tue, 14 May 2024 23:06:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EN6oAS047492; Tue, 14 May 2024 23:06:50 GMT (envelope-from git) Date: Tue, 14 May 2024 23:06:50 GMT Message-Id: <202405142306.44EN6oAS047492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c6113ac5a2c2 - main - 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/main X-Git-Reftype: branch X-Git-Commit: c6113ac5a2c2bfee875979ebd40a007ef4d60069 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c6113ac5a2c2bfee875979ebd40a007ef4d60069 commit c6113ac5a2c2bfee875979ebd40a007ef4d60069 Author: Konstantin Belousov AuthorDate: 2024-05-13 23:02:16 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-14 23:06:23 +0000 AMD CPUs: update bits and data from CPUID 0x8000_0008 from AMD APM vol3 doc no 24594 Rev. 3.36 March 2024 Reviewed and tested by: emaste Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45188 --- 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 b4b95670e367..3115056ce14c 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -397,21 +397,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 @@ -420,6 +430,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 953736d6b25c..4da250c535a0 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -106,6 +106,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 */ @@ -1089,19 +1090,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" ); } @@ -1664,6 +1675,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; }